use a matrix for building some test roms #182
Workflow file for this run
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: build and release | |
on: push | |
env: | |
ARTIFACTS_NAME: job-artifacts | |
ARTIFACTS_PATH: artifacts | |
ZIP_ARTIFACT_NAME: game-boy-test-roms.zip | |
RGBDS_ARTIFACT_NAME: artifact-tools-rgbds | |
WLADX_ARTIFACT_NAME: artifact-tools-wla-dx | |
jobs: | |
# make the tools required for some build jobs | |
tools: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
tool: [rgbds, wla-dx] | |
steps: | |
- uses: actions/checkout@v4 | |
- run: src/assemble.sh ${{ matrix.tool }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }}-${{ matrix.tool }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
# build test roms using the tools created above | |
# build test roms (no tools required) | |
test-roms-no-tools: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
suite: [blargg-roms, gambatte-roms, mooneye-test-suite-wilbertpol, rtc3test] | |
steps: | |
- uses: actions/checkout@v4 | |
- run: src/assemble.sh ${{ matrix.suite }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }}-${{ matrix.suite }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
bully: | |
name: build bully.gb | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build bully.gb | |
run: src/assemble.sh bully | |
- name: upload bully.gb artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
age-test-roms: | |
name: build age-test-roms | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build age-test-roms | |
run: src/assemble.sh age-test-roms | |
- name: upload age-test-roms artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
dmg-acid2: | |
name: build dmg-acid2 test rom | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build dmg-acid2 test rom | |
run: src/assemble.sh dmg-acid2 | |
- name: upload dmg-acid2 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
cgb-acid2: | |
name: build cgb-acid2 test rom | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build cgb-acid2 test rom | |
run: src/assemble.sh cgb-acid2 | |
- name: upload cgb-acid2 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
cgb-acid-hell: | |
name: build cgb-acid-hell test rom | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build cgb-acid-hell test rom | |
run: src/assemble.sh cgb-acid-hell | |
- name: upload cgb-acid-hell artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
little-things-gb: | |
name: build (parts of) little-things-gb | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build (parts of) little-things-gb | |
run: src/assemble.sh little-things-gb | |
- name: upload little-things-gb artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
mealybug-tearoom-tests: | |
name: build mealybug-tearoom-tests | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build mealybug-tearoom-tests | |
run: src/assemble.sh mealybug-tearoom-tests | |
- name: upload mealybug-tearoom-tests artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
mooneye-test-suite: | |
name: build Mooneye Test Suite | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.WLADX_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: assemble Mooneye Test Suite | |
run: src/assemble.sh mooneye-test-suite | |
- name: upload Mooneye Test Suite artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
gbmicrotest: | |
name: build GBMicrotest | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.WLADX_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: assemble GBMicrotest | |
run: src/assemble.sh gbmicrotest | |
- name: upload GBMicrotest artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
same-suite: | |
name: build same-suite | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build same-suite | |
run: src/assemble.sh same-suite | |
- name: upload same-suite artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
strikethrough: | |
name: build strikethrough.gb | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.RGBDS_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
- name: build strikethrough.gb | |
run: src/assemble.sh strikethrough | |
- name: upload strikethrough.gb artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
create-release-zip: | |
name: create release zip | |
runs-on: ubuntu-latest | |
needs: [ | |
test-roms-no-tools, | |
age-test-roms, | |
bully, | |
cgb-acid2, | |
cgb-acid-hell, | |
dmg-acid2, | |
little-things-gb, | |
gbmicrotest, | |
mealybug-tearoom-tests, | |
mooneye-test-suite, | |
same-suite, | |
strikethrough | |
] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.ARTIFACTS_PATH }} | |
merge-multiple: true | |
- name: zip artifacts | |
run: src/assemble.sh release-zip $ZIP_ARTIFACT_NAME | |
- name: upload zipped artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ZIP_ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACTS_PATH }}/${{ env.ZIP_ARTIFACT_NAME }} | |
# Releases are created automatically for each pushed tag. | |
# Creating a new tag without any additional release information is | |
# (as of 2020-06-13) not possible using the github.com website. | |
# Instead, create a new tag via CLI: | |
# git tag -a v1.0 -m "release v1.0" | |
# git push origin --tags | |
# | |
# Release preparations: | |
# - adjust CHANGELOG.md | |
# - adjust README.md (readme link) | |
# - push new tag | |
# | |
upload-new-release: | |
name: upload new release | |
runs-on: ubuntu-latest | |
needs: [ create-release-zip ] | |
if: startsWith( github.ref, 'refs/tags/v' ) | |
steps: | |
- name: download zipped artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ZIP_ARTIFACT_NAME }} | |
path: ./ | |
- name: get release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: create release ${{ env.RELEASE_VERSION }} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
release_name: ${{ env.RELEASE_VERSION }} | |
draft: false | |
prerelease: false | |
- name: upload release ${{ env.RELEASE_VERSION }} asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# This pulls from the CREATE RELEASE step above, | |
# referencing its ID to get its outputs object, | |
# which include a `upload_url`. | |
# See this blog post for more info: | |
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.ZIP_ARTIFACT_NAME }} | |
asset_name: game-boy-test-roms-${{ env.RELEASE_VERSION }}.zip | |
asset_content_type: application/zip |