From f14416522407f6f77c26a6353d4347f4bf2564c2 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Thu, 1 Feb 2024 14:25:52 +0000 Subject: [PATCH] add build and release workflow --- .github/workflows/build.yaml | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000000..ac5c55f0b6 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,69 @@ +name: Build +on: + push: + pull_request: + +jobs: + game: + name: Game + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Install dependencies + run: ./install_deps.sh + - name: Install compilers + run: ./install_compilers.sh + - name: Install Flips + run: flatpak install com.github.Alcaro.Flips -y + - name: Download baserom + run: curl -L $BASEROM_US_URL -o ver/us/baserom.z64 + env: + BASEROM_US_URL: ${{ secrets.BASEROM_US_URL }} + - name: Configure + run: ./configure.sh + - name: Build + run: ninja + - name: Create patch file + run: flips ver/us/baserom.z64 ver/us/build/papermario.z64 ver/us/build/papermario.bps + - name: Upload patch as artifact + uses: actions/upload-artifact@v2 + with: + name: papermario.bps + path: ver/us/build/papermario.bps + prerelease: + name: Prerelease + runs-on: ubuntu-latest + needs: game + if: github.ref == 'refs/heads/main' + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: papermario.bps + path: papermario.bps + - uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: Development build + files: papermario.bps + release: + name: Release + runs-on: ubuntu-latest + needs: game + if: github.ref == 'refs/tags/v*' + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: papermario.bps + path: papermario.bps + - uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + files: papermario.bps