Build ROMs #107
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 ROMs | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
schedule: | |
- cron: '0 11 * * 0' | |
jobs: | |
build-roms: | |
name: Build ROMs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Bun 1.0.30 | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.0.30 | |
- name: Install scripts dependencies | |
run: cd scripts && bun install && cd .. | |
- name: Install GBDK-2020 | |
run: | | |
wget https://github.com/gbdk-2020/gbdk-2020/releases/latest/download/gbdk-linux64.tar.gz | |
tar -xzf gbdk-linux64.tar.gz | |
rm gbdk-linux64.tar.gz | |
mv gbdk ~ | |
- name: Generate dynamic pages | |
run: cd scripts && bun run generate && cd .. | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Build ROMs | |
run: | | |
make | |
- name: Upload ROMs to GitHub Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ROMs | |
path: build | |
- name: Generate pre-release tag | |
id: tag | |
# Only publish pre-release if the CI is running for a | |
# cronjob or for a push of a branch, not for a tag | |
if: github.event_name == 'schedule' || startsWith(github.ref, 'refs/heads/') | |
run: | | |
echo "::set-output name=prerelease_id::$(date +"%Y-%m-%dT%H%M")" | |
- name: Generate release notes | |
id: notes | |
run: | | |
git fetch --unshallow | |
latest_tag=$(git describe --tags --abbrev=0) | |
echo "::set-output name=latest_tag::$latest_tag" | |
if [ "${{ github.event_name }}" == "schedule" ]; then | |
echo "::set-output name=release_notes::Regenerate ROMs with freshly gathered data" | |
else | |
echo "::set-output name=release_notes::$(git --no-pager log $latest_tag..HEAD --oneline --no-merges --pretty=format:'* %s in commit %h')" | |
fi | |
- name: Publish pre-release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Only publish pre-release if the CI is running for a push of a branch and not for a tag | |
if: startsWith(github.ref, 'refs/heads/') | |
with: | |
name: 'Nightly ${{ steps.tag.outputs.prerelease_id }}' | |
tag_name: 'nightly-${{ steps.tag.outputs.prerelease_id }}' | |
body: | | |
## What's Changed | |
${{ steps.notes.outputs.release_notes }} | |
**Full Changelog**: https://github.com/Dabolus/portfolio-cartridge/compare/${{ steps.notes.outputs.latest_tag }}...nightly-${{ steps.tag.outputs.prerelease_id }} | |
prerelease: true | |
files: | | |
build/gb/portfolio.gb | |
build/gbc/portfolio.gbc | |
build/pocket/portfolio.pocket | |
build/duck/portfolio.duck |