chore: bump version to v0.4.0, archive closed tasks, snapshot overviews #2
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Version tag to release (e.g. v1.0.0) — must already exist" | |
| required: true | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write # needed to create GitHub Releases and upload assets | |
| jobs: | |
| # ─── Host unit tests ─────────────────────────────────────────────────────── | |
| test: | |
| name: Host Unit Tests | |
| runs-on: ubuntu-latest | |
| container: mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B .vscode/build \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -Wno-dev | |
| - name: Build tests | |
| run: cmake --build .vscode/build --target pedal_tests -j$(nproc) | |
| - name: Run tests | |
| run: .vscode/build/test/pedal_tests --gtest_brief=1 | |
| # ─── Firmware build — ESP32 ──────────────────────────────────────────────── | |
| build-esp32: | |
| name: Build ESP32 firmware | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install PlatformIO | |
| run: pip install --quiet platformio | |
| - name: Build ESP32 firmware | |
| run: pio run -e nodemcu-32s | |
| - name: Rename binary | |
| run: | | |
| TAG="${{ github.ref_name }}${{ github.event.inputs.tag }}" | |
| cp .pio/build/nodemcu-32s/firmware.bin \ | |
| awesome-pedal-esp32-${TAG}.bin | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-esp32 | |
| path: awesome-pedal-esp32-*.bin | |
| retention-days: 7 | |
| # ─── Firmware build — nRF52840 ───────────────────────────────────────────── | |
| build-nrf52840: | |
| name: Build nRF52840 firmware | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install PlatformIO | |
| run: pip install --quiet platformio | |
| - name: Build nRF52840 firmware | |
| run: pio run -e feather-nrf52840 | |
| - name: Rename binary | |
| run: | | |
| TAG="${{ github.ref_name }}${{ github.event.inputs.tag }}" | |
| cp .pio/build/feather-nrf52840/firmware.bin \ | |
| awesome-pedal-nrf52840-${TAG}.bin | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-nrf52840 | |
| path: awesome-pedal-nrf52840-*.bin | |
| retention-days: 7 | |
| # ─── GitHub Release ──────────────────────────────────────────────────────── | |
| release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: [build-esp32, build-nrf52840] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # full history for changelog generation | |
| - name: Resolve version tag | |
| id: tag | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| echo "value=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| TAG="${{ steps.tag.outputs.value }}" | |
| PREV=$(git tag -l 'v*' | sort -V | grep -B1 "^${TAG}$" | head -1 || true) | |
| if [[ -n "$PREV" && "$PREV" != "$TAG" ]]; then | |
| RANGE="${PREV}..${TAG}" | |
| else | |
| RANGE="${TAG}" | |
| fi | |
| { | |
| echo "body<<EOF" | |
| echo "## What's Changed" | |
| echo "" | |
| git log "$RANGE" --pretty="- %s (%h)" --no-merges | |
| echo "" | |
| echo "**Full diff**: [\`${PREV}..${TAG}\`](../../compare/${PREV}...${TAG})" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Download ESP32 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: firmware-esp32 | |
| - name: Download nRF52840 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: firmware-nrf52840 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.value }} | |
| name: "AwesomeStudioPedal ${{ steps.tag.outputs.value }}" | |
| body: ${{ steps.changelog.outputs.body }} | |
| files: | | |
| awesome-pedal-esp32-*.bin | |
| awesome-pedal-nrf52840-*.bin | |
| draft: false | |
| prerelease: false | |
| - name: Archive closed tasks for this release | |
| run: | | |
| python scripts/organize_closed_tasks.py ${{ steps.tag.outputs.value }} | |
| - name: Commit archived tasks if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if ! git diff --quiet HEAD; then | |
| git add docs/developers/tasks/ | |
| git commit -m "chore: archive closed tasks for ${{ steps.tag.outputs.value }}" | |
| git push | |
| fi |