reformat build-and-release.yml, fix assemble-all.sh #202
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_PATH: artifacts | |
ZIP_ARTIFACT_NAME: game-boy-test-roms.zip | |
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 }} | |
ls ${{ env.ARTIFACTS_PATH }} -lsah | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }}-${{ matrix.tool }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
# build test roms using the tools created above | |
test-roms: | |
runs-on: ubuntu-latest | |
needs: [ tools ] | |
strategy: | |
fail-fast: false | |
matrix: | |
suite: | |
- age-test-roms | |
- bully | |
- cgb-acid-hell | |
- cgb-acid2 | |
- dmg-acid2 | |
- gbmicrotest | |
- little-things-gb | |
- mbc3-tester | |
- mealybug-tearoom-tests | |
- mooneye-test-suite | |
- same-suite | |
- strikethrough | |
- turtle-tests | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: artifact-tools-* | |
path: ${{ env.ARTIFACTS_PATH }} | |
merge-multiple: true | |
- run: | | |
src/assemble.sh ${{ matrix.suite }} | |
ls ${{ env.ARTIFACTS_PATH }} -lsah | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }}-${{ matrix.suite }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
# 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 | |
- scribbltests | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
src/assemble.sh ${{ matrix.suite }} | |
ls ${{ env.ARTIFACTS_PATH }} -lsah | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ github.job }}-${{ matrix.suite }} | |
path: ${{ env.ARTIFACTS_PATH }} | |
# create a releasable zip | |
create-release-zip: | |
name: create release zip | |
runs-on: ubuntu-latest | |
needs: [ test-roms, test-roms-no-tools ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.ARTIFACTS_PATH }} | |
merge-multiple: true | |
- run: | | |
src/assemble.sh release-zip $ZIP_ARTIFACT_NAME | |
ls ${{ env.ARTIFACTS_PATH }} -lsah | |
- 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: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ZIP_ARTIFACT_NAME }} | |
path: ./ | |
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- 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 | |
- 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 |