diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 056bdd30..7b1ab008 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -511,6 +511,58 @@ jobs: name: ph-randomizer_${{ steps.commit-hash.outputs.hash }}_${{ matrix.os }} path: dist/ + run-executable: + name: Run built randomizer executable [${{ matrix.rom_variant }}] + needs: [build] + runs-on: ${{ matrix.os }}-latest + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos, windows] + include: + - rom_variant: US + google_drive_url_secret: PH_US_GOOGLE_DRIVE_ID + - rom_variant: US (D-Pad Patch) + google_drive_url_secret: PH_US_DPAD_GOOGLE_DRIVE_ID + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: '.python-version' + check-latest: true + + - name: Upgrade `pip` and install `wheel` + run: python -m pip install --upgrade pip wheel + + - name: Fetch PH rom + run: | + pip install gdown + gdown ${{ secrets[matrix.google_drive_url_secret] }} + + - name: Get filename of rom + id: rom-filename + run: echo "rom_filename=$(ls *.nds)" >> $GITHUB_OUTPUT + + - name: Get current commit hash + id: commit-hash + run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Download built executable from previous job + uses: actions/download-artifact@v3 + with: + name: ph-randomizer_${{ steps.commit-hash.outputs.hash }}_${{ matrix.os }} + + - name: Run executable (no GUI) + run: ph-randomizer_${{ steps.commit-hash.outputs.hash }}_${{ matrix.os }}/ph_rando --no-gui --input-rom-path="${{ steps.rom-filename.outputs.rom_filename }}" --output-rom-path="out.nds" + + - name: Cleanup + run: rm -rf *.nds + release: name: Publish a release # Require all tests to pass before a release is possible @@ -523,6 +575,7 @@ jobs: - check-aux-data - run-shuffler - test-desmume + - run-executable # Only create a release if a tag was pushed if: "startsWith(github.ref, 'refs/tags/')" runs-on: ubuntu-latest