Publish #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: workflow_dispatch | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| call_get_app_metadata: | |
| # This job digests repository metadata provided by the `ledger_app.toml` manifest | |
| # file, in order to output relevant directories, compatible devices, and other variables needed | |
| # by following jobs. | |
| name: Retrieve application metadata | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml@v1 | |
| build_application: | |
| name: Build application using the reusable workflow | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | |
| with: | |
| upload_app_binaries_artifact: "compiled_app_binaries" | |
| builder: ledger-app-builder | |
| upload-assets: | |
| needs: [call_get_app_metadata, build_application] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: set version env variable | |
| run: echo "CRATE_VERSION=$(cat rust-app/Cargo.toml | sed -n 's/.*version = "\([^"]*\)".*/\1/p' | head -1)" >> $GITHUB_ENV | |
| - name: Download app binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ inputs.download_app_binaries_artifact }} | |
| path: ${{ needs.call_get_app_metadata.outputs.build_directory }} | |
| - name: Create release archives | |
| run: | | |
| mkdir flex | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/flex/release/iota flex/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/flex/release/iota.hex flex/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/flex/release/app_flex.json flex/ | |
| mkdir -p flex/icons | |
| cp rust-app/icons/iota_40x40.gif flex/icons/ | |
| tar cfzv flex.tar.gz flex | |
| mkdir nanosplus | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanosplus/release/iota nanosplus/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanosplus/release/iota.hex nanosplus/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanosplus/release/app_nanosplus.json nanosplus/ | |
| mkdir -p nanosplus/icons | |
| cp rust-app/icons/iota_14x14.gif nanosplus/icons/ | |
| tar cfzv nanosplus.tar.gz nanosplus | |
| mkdir nanox | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanox/release/iota nanox/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanox/release/iota.hex nanox/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanox/release/app_nanox.json nanox/ | |
| mkdir -p nanox/icons | |
| cp rust-app/icons/iota_14x14.gif nanox/icons/ | |
| tar cfzv nanox.tar.gz nanox | |
| mkdir stax | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/stax/release/iota stax/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/stax/release/iota.hex stax/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/stax/release/app_stax.json stax/ | |
| mkdir -p stax/icons | |
| cp rust-app/icons/iota_32x32.gif stax/icons/ | |
| tar cfzv stax.tar.gz stax | |
| mkdir apex_p | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/apex_p/release/iota apex_p/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/apex_p/release/iota.hex apex_p/ | |
| cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/apex_p/release/app_apex_p.json apex_p/ | |
| mkdir -p apex_p/icons | |
| cp rust-app/icons/iota_32x32.png apex_p/icons/ | |
| tar cfzv apex_p.tar.gz apex_p | |
| - name: Add SHA-256 checksums to release | |
| run: | | |
| echo "|Asset|SHA-256 checksum|" >> ./.github/workflows/release/release-text.txt | |
| echo "|---|---|" >> ./.github/workflows/release/release-text.txt | |
| echo "|flex.tar.gz|$(shasum -a 256 flex.tar.gz | cut -f 1 -d " ")|" >> ./.github/workflows/release/release-text.txt | |
| echo "|nanosplus.tar.gz|$(shasum -a 256 nanosplus.tar.gz | cut -f 1 -d " ")|" >> ./.github/workflows/release/release-text.txt | |
| echo "|nanox.tar.gz|$(shasum -a 256 nanox.tar.gz | cut -f 1 -d " ")|" >> ./.github/workflows/release/release-text.txt | |
| echo "|stax.tar.gz|$(shasum -a 256 stax.tar.gz | cut -f 1 -d " ")|" >> ./.github/workflows/release/release-text.txt | |
| echo "|apex_p.tar.gz|$(shasum -a 256 apex_p.tar.gz | cut -f 1 -d " ")|" >> ./.github/workflows/release/release-text.txt | |
| # upload binary to the GH release | |
| - name: upload release assets | |
| id: upload-release-assets | |
| uses: softprops/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: "ledger-app-iota-v${{ env.CRATE_VERSION }}" | |
| tag_name: "ledger-app-iota-v${{ env.CRATE_VERSION }}" | |
| body_path: ./.github/workflows/release/release-text.txt | |
| draft: true | |
| prerelease: true | |
| files: | | |
| flex.tar.gz | |
| nanosplus.tar.gz | |
| nanox.tar.gz | |
| stax.tar.gz | |
| apex_p.tar.gz |