Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 10 additions & 65 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,17 @@
name: Build and publish release binaries

name: GitHub release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write
packages: read

jobs:
build_application:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
github-release:
name: GitHub release using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_app_release.yml@v1
if: startsWith(github.ref, 'refs/tags/')
with:
upload_app_binaries_artifact: "release_elfs"

release:
name: Create GitHub Release with ELF binaries
needs: build_application
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Download built binaries
uses: actions/download-artifact@v7
with:
name: release_elfs
path: binaries

- name: Rename ELF files per device
run: |
ls -la binaries/
mkdir release_assets
for device_dir in binaries/*/; do
device=$(basename "$device_dir")
if [ -f "${device_dir}bin/app.elf" ]; then
cp "${device_dir}bin/app.elf" "release_assets/app-${GITHUB_REF_NAME}-${device}.elf"
fi
done
ls -la release_assets/

- name: Extract release notes from CHANGELOG.md
id: changelog
run: |
VERSION="${GITHUB_REF_NAME}"
# Extract the section for this version from CHANGELOG.md
# Matches from "## [x.y.z]" until the next "## [" or end of file
NOTES=$(awk -v ver="$VERSION" '
BEGIN { found=0 }
/^## \[/ {
if (found) exit
if (index($0, "[" ver "]")) { found=1; next }
}
found { print }
' CHANGELOG.md)

if [ -z "$NOTES" ]; then
echo "Warning: No changelog entry found for version $VERSION"
NOTES="Release $VERSION"
fi

# Write to file to avoid delimiter issues
echo "$NOTES" > release_notes.md

- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
-F release_notes.md \
release_assets/*.elf
app_ref_name: ${{ github.ref_name }}
Loading