Skip to content

Commit 41c1d2b

Browse files
committed
Use [patch] field in Cargo.toml
1 parent a5e1a1d commit 41c1d2b

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/reusable_build_and_test_with_last_nightly.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,30 @@ jobs:
5858
repository: LedgerHQ/${{ inputs.app_name }}
5959
ref: ${{ inputs.app_branch }}
6060
path: ${{ inputs.app_name }}
61+
submodules: true
6162

62-
- name: Patch Cargo.toml to use y333/nightly_support for ledger_device_sdk and include_gif crate
63+
- name: Patch Cargo.toml to use y333/nightly_support for ledger_device_sdk, ledger_secure_sdk_sys, include_gif crates
6364
run: |
6465
cd ${{ inputs.app_name }}/${{ needs.call_get_app_metadata.outputs.build_directory }}
65-
sed -i 's|ledger_device_sdk = ".*"|ledger_device_sdk = { git = "https://github.com/LedgerHQ/ledger-device-rust-sdk.git", branch = "y333/nightly_support" }|' Cargo.toml
66-
sed -i 's|include_gif = ".*"|include_gif = { git = "https://github.com/LedgerHQ/ledger-device-rust-sdk.git", branch = "y333/nightly_support" }|' Cargo.toml
66+
67+
# Patch include_gif
68+
echo "" >> Cargo.toml && \
69+
echo "[patch.crates-io.include_gif]" >> Cargo.toml && \
70+
echo "git = \"https://github.com/LedgerHQ/ledger-device-rust-sdk.git\"" >> Cargo.toml && \
71+
echo "branch = \"y333/nightly_support\"" >> Cargo.toml
72+
73+
# Patch ledger_secure_sdk_sys
74+
echo "" >> Cargo.toml && \
75+
echo "[patch.crates-io.ledger_secure_sdk_sys]" >> Cargo.toml && \
76+
echo "git = \"https://github.com/LedgerHQ/ledger-device-rust-sdk.git\"" >> Cargo.toml && \
77+
echo "branch = \"y333/nightly_support\"" >> Cargo.toml
78+
79+
# Patch ledger_device_sdk
80+
echo "" >> Cargo.toml && \
81+
echo "[patch.crates-io.ledger_device_sdk]" >> Cargo.toml && \
82+
echo "git = \"https://github.com/LedgerHQ/ledger-device-rust-sdk.git\"" >> Cargo.toml && \
83+
echo "branch = \"y333/nightly_support\"" >> Cargo.toml
84+
6785
echo "Display patched Cargo.toml:"
6886
cat Cargo.toml
6987

0 commit comments

Comments
 (0)