Publish #1
This file contains 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: Rename and move files | |
run: | | |
mv ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanos/release/iota iota-nanos | |
mv ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanos/release/app.hex iota-nanos-app.hex | |
mv ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanosplus/release/iota iota-nanosplus | |
mv ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanosplus/release/app.hex iota-nanosplus-app.hex | |
mv ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanox/release/iota iota-nanox | |
mv ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanox/release/app.hex iota-nanox-app.hex | |
mv ./.github/workflows/release/*.json ./ | |
tar cfzv nanos.tar.gz iota-nanos iota-nanos-app.hex app_nanos.json | |
tar cfzv nanosplus.tar.gz iota-nanosplus iota-nanosplus-app.hex app_nanosplus.json | |
tar cfzv nanox.tar.gz iota-nanox iota-nanox-app.hex app_nanox.json | |
- 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 "|nanos.tar.gz|$(shasum -a 256 nanos.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 | |
# 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: | | |
nanos.tar.gz | |
nanosplus.tar.gz | |
nanox.tar.gz |