Publish #3
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: Create release archives | |
run: | | |
mkdir nanos nanosplus nanox | |
cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanos/release/iota nanos/ | |
cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanos/release/iota.hex nanos/ | |
cp ${{ needs.call_get_app_metadata.outputs.build_directory }}/compiled_app_binaries/nanos/release/app_nanos.json nanos/ | |
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/ | |
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/ | |
tar cfzv nanos.tar.gz nanos | |
tar cfzv nanosplus.tar.gz nanosplus | |
tar cfzv nanox.tar.gz nanox | |
- 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 |