gba release: drop _payload.c attachments #6
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 | |
| # Triggered by tags shaped like <console>-v<semver>, e.g. gcn-v0.1.0, | |
| # pce-v0.2.3, etc. The console subdir comes from the prefix; only that | |
| # console's app is built and attached to a GitHub Release. | |
| on: | |
| push: | |
| tags: | |
| - '*-v[0-9]+.[0-9]+.[0-9]+' | |
| - '*-v[0-9]+.[0-9]+.[0-9]+-*' # pre-release suffixes (alpha, rc, etc.) | |
| permissions: | |
| contents: write # needed to create the release | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | |
| jobs: | |
| parse: | |
| name: Parse tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| console: ${{ steps.split.outputs.console }} | |
| version: ${{ steps.split.outputs.version }} | |
| title: ${{ steps.split.outputs.title }} | |
| steps: | |
| - id: split | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| CONSOLE="${TAG%%-v*}" | |
| VERSION="${TAG#*-v}" | |
| case "$CONSOLE" in | |
| gcn) PRETTY="GameCube" ;; | |
| wii) PRETTY="Wii" ;; | |
| n64) PRETTY="Nintendo 64" ;; | |
| snes) PRETTY="Super Nintendo" ;; | |
| gba) PRETTY="Game Boy Advance" ;; | |
| pce) PRETTY="PC Engine" ;; | |
| *) PRETTY="$CONSOLE" ;; | |
| esac | |
| echo "console=$CONSOLE" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "title=Joypad Tester — $PRETTY v$VERSION" >> "$GITHUB_OUTPUT" | |
| build-and-release: | |
| name: Build + release ${{ needs.parse.outputs.console }} v${{ needs.parse.outputs.version }} | |
| needs: parse | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Verify VERSION matches tag | |
| run: | | |
| FILE_VER="$(cat ${{ needs.parse.outputs.console }}/VERSION | tr -d '[:space:]')" | |
| if [ "$FILE_VER" != "${{ needs.parse.outputs.version }}" ]; then | |
| echo "::error::${{ needs.parse.outputs.console }}/VERSION ($FILE_VER) does not match tag (${{ needs.parse.outputs.version }})" | |
| exit 1 | |
| fi | |
| - name: Set up Python | |
| if: needs.parse.outputs.console == 'gcn' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Pillow | |
| if: needs.parse.outputs.console == 'gcn' | |
| run: pip install --quiet Pillow | |
| - name: Generate banner | |
| if: needs.parse.outputs.console == 'gcn' | |
| working-directory: ${{ needs.parse.outputs.console }} | |
| run: python3 buildtools/make_banner.py opening.bnr | |
| - name: Generate screensaver logo header | |
| if: needs.parse.outputs.console == 'gcn' | |
| working-directory: ${{ needs.parse.outputs.console }} | |
| run: python3 buildtools/make_logo.py | |
| - name: Build (GameCube) | |
| if: needs.parse.outputs.console == 'gcn' | |
| run: | | |
| docker run --rm \ | |
| -v "${{ github.workspace }}":/workspace \ | |
| -w /workspace/${{ needs.parse.outputs.console }} \ | |
| -u "$(id -u):$(id -g)" \ | |
| ghcr.io/extremscorner/libogc2:latest \ | |
| bash -c "apt-get install -y -qq --no-install-recommends -t bookworm-backports xorriso 2>/dev/null; TARGET_CONSOLE=gamecube make && TARGET_CONSOLE=wii make" | |
| - name: Build (GBA — both variants) | |
| if: needs.parse.outputs.console == 'gba' | |
| run: | | |
| docker run --rm \ | |
| -v "${{ github.workspace }}":/workspace \ | |
| -w /workspace/gba \ | |
| -u "$(id -u):$(id -g)" \ | |
| devkitpro/devkitarm:latest \ | |
| make | |
| - name: Build (PC Engine) | |
| if: needs.parse.outputs.console == 'pce' | |
| run: | | |
| docker build -t joypad-tester-huc:release pce/buildtools/ | |
| docker run --rm \ | |
| -v "${{ github.workspace }}":/workspace \ | |
| -w /workspace/pce \ | |
| -u "$(id -u):$(id -g)" \ | |
| joypad-tester-huc:release \ | |
| make | |
| - name: Stage release artifacts (GameCube) | |
| if: needs.parse.outputs.console == 'gcn' | |
| working-directory: ${{ needs.parse.outputs.console }} | |
| run: | | |
| mkdir -p _release | |
| for f in *.dol opening.bnr; do | |
| [ -f "$f" ] && cp "$f" _release/ | |
| done | |
| ls -la _release/ | |
| - name: Stage release artifacts (GBA) | |
| if: needs.parse.outputs.console == 'gba' | |
| working-directory: gba | |
| run: | | |
| mkdir -p _release | |
| # Only the playable .gba ROMs go in the public release. | |
| # _payload.c (C-array form for compile-time embedding) lives in | |
| # the committed gba/build/ tree; submodule consumers like | |
| # joypad-os pull it from the working tree, not from a Release | |
| # artifact, so attaching it to the Release would be noise. | |
| cp build/joypad/joypad_mb.gba _release/ | |
| cp build/tester/tester_mb.gba _release/ | |
| ls -la _release/ | |
| - name: Stage release artifacts (PC Engine) | |
| if: needs.parse.outputs.console == 'pce' | |
| working-directory: pce | |
| run: | | |
| mkdir -p _release | |
| cp build/joypad-tester.pce _release/ | |
| ls -la _release/ | |
| - name: Extract changelog section for this version | |
| id: notes | |
| working-directory: ${{ needs.parse.outputs.console }} | |
| run: | | |
| VERSION="${{ needs.parse.outputs.version }}" | |
| if [ -f CHANGELOG.md ]; then | |
| awk -v ver="v$VERSION" ' | |
| /^## / { | |
| if (capture) exit | |
| if (index($0, ver)) capture = 1 | |
| next | |
| } | |
| capture { print } | |
| ' CHANGELOG.md > _notes.md | |
| fi | |
| if [ ! -s _notes.md ]; then | |
| echo "Release ${{ needs.parse.outputs.title }}." > _notes.md | |
| fi | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ needs.parse.outputs.title }} | |
| body_path: ${{ needs.parse.outputs.console }}/_notes.md | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }} | |
| files: ${{ needs.parse.outputs.console }}/_release/* |