-
Notifications
You must be signed in to change notification settings - Fork 32
83 lines (75 loc) · 3 KB
/
build_all_apps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build all Rust apps
on:
workflow_dispatch:
inputs:
sdk_branch:
type: string
required: false
default: ''
pull_request:
jobs:
test-build:
name: Build for all targets
strategy:
fail-fast: false
matrix:
include:
- repo: 'app-mobilecoin'
branch: 'develop'
build_path: './fw'
device: nanosplus
- repo: 'app-radix-babylon'
branch: 'develop'
build_path: './'
device: nanos nanox nanosplus
- repo: 'app-boilerplate-rust'
branch: 'main'
build_path: './'
device: nanos nanox nanosplus
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Clone SDK
uses: actions/checkout@v4
with:
path: sdk
- name: Clone App
uses: actions/checkout@v4
with:
repository: LedgerHQ/${{ matrix.repo }}
submodules: true
ref: ${{ matrix.branch }}
path: ${{ matrix.repo }}-${{ matrix.branch }}
- name: Patch Cargo.toml
run: |
cd ${{ matrix.repo }}-${{ matrix.branch }}/${{ matrix.build_path }}
if grep -Fxq "[patch.crates-io.ledger_device_sdk]" Cargo.toml; then
echo "The patch already exists in the file."
else
echo "" >> Cargo.toml
echo "[patch.crates-io.ledger_device_sdk]" >> Cargo.toml
path=\"$GITHUB_WORKSPACE/sdk/ledger_device_sdk\"
echo "path=$path" >> Cargo.toml
echo "Patch added to Cargo.toml"
fi
if grep -Fxq "[patch.crates-io.ledger_secure_sdk_sys]" Cargo.toml; then
echo "The patch already exists in the file."
else
echo "" >> Cargo.toml
echo "[patch.crates-io.ledger_secure_sdk_sys]" >> Cargo.toml
path=\"$GITHUB_WORKSPACE/sdk/ledger_secure_sdk_sys\"
echo "path=$path" >> Cargo.toml
echo "Patch added to Cargo.toml"
fi
- name: Build
run: |
cd ${{ matrix.repo }}-${{ matrix.branch }}/${{ matrix.build_path }}
for device in ${{ matrix.device }}; do
echo "Build for"
echo $device
cat Cargo.toml
cargo +$RUST_NIGHTLY update ledger_device_sdk
cargo +$RUST_NIGHTLY update ledger_secure_sdk_sys
cargo ledger build $device
done