release v0.3.2 #42
Workflow file for this run
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: firmware | |
| # Build the Spore firmware on every push/PR, and publish a GitHub Release with the | |
| # binaries whenever a version tag (vX.Y.Z) is pushed. | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # needed to create Releases on tag builds | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (with submodules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 # full history so `git describe` can see tags | |
| - name: Install ARM GCC toolchain | |
| uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
| with: | |
| release: '12.3.Rel1' # matches the local xPack 12.3.x toolchain | |
| - name: Derive version | |
| id: ver | |
| run: | | |
| if [ "${GITHUB_REF_TYPE}" = "tag" ]; then | |
| VER="${GITHUB_REF_NAME}" | |
| else | |
| VER="$(git describe --tags --always --dirty 2>/dev/null || echo dev)" | |
| fi | |
| echo "version=$VER" >> "$GITHUB_OUTPUT" | |
| echo "Building version: $VER" | |
| - name: Build libDaisy + DaisySP | |
| run: | | |
| make -C lib/libDaisy -j"$(nproc)" | |
| make -C lib/DaisySP -j"$(nproc)" | |
| - name: Build firmware | |
| run: make -j"$(nproc)" | |
| - name: Collect artifacts | |
| run: | | |
| mkdir -p dist | |
| V="${{ steps.ver.outputs.version }}" | |
| for ext in bin hex elf; do | |
| cp "build/daisy_synth.$ext" "dist/spore-${V}.$ext" | |
| done | |
| ls -l dist | |
| # size report (handy in the build log) | |
| arm-none-eabi-size build/daisy_synth.elf || true | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: spore-${{ steps.ver.outputs.version }} | |
| path: dist/* | |
| if-no-files-found: error | |
| - name: Extract changelog section for this tag | |
| if: github.ref_type == 'tag' | |
| run: | | |
| awk -v h="## [${GITHUB_REF_NAME}]" 'index($0,h)==1{f=1;next} f&&(/^## \[/||/^<!--/){exit} f{print}' \ | |
| CHANGELOG.md > RELEASE_NOTES.md | |
| if [ ! -s RELEASE_NOTES.md ]; then echo "Release ${GITHUB_REF_NAME}" > RELEASE_NOTES.md; fi | |
| echo "----- release notes -----"; cat RELEASE_NOTES.md | |
| - name: Publish Release (tags only) | |
| if: github.ref_type == 'tag' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| body_path: RELEASE_NOTES.md | |
| fail_on_unmatched_files: true |