From 27686e80be557cf98aed331d9161167c69491dbd Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:37:11 +0200 Subject: [PATCH 1/4] Update GitHub Actions --- .github/workflows/checks.yml | 4 ++-- .github/workflows/clang_format_code.yml | 2 +- .github/workflows/create_build.yml | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7b95a196..9ebfcd28 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout Project - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v6.0.2 - name: Format Project uses: DoozyX/clang-format-lint-action@v0.15 @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout Project - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v6.0.2 - name: Compile Project run: | diff --git a/.github/workflows/clang_format_code.yml b/.github/workflows/clang_format_code.yml index 45556972..26fb44ca 100644 --- a/.github/workflows/clang_format_code.yml +++ b/.github/workflows/clang_format_code.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.3 + - uses: actions/checkout@v6.0.2 - uses: DoozyX/clang-format-lint-action@v0.15 with: diff --git a/.github/workflows/create_build.yml b/.github/workflows/create_build.yml index 50d85fb6..3c25c960 100644 --- a/.github/workflows/create_build.yml +++ b/.github/workflows/create_build.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Project - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v6.0.2 with: fetch-depth: 0 - name: Get Last Nightly @@ -29,7 +29,7 @@ jobs: echo "last_nightly=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV - name: Generate changelog id: changelog - uses: metcalfc/changelog-generator@v4.3.1 + uses: metcalfc/changelog-generator@v4.7.0 with: myToken: ${{ secrets.GITHUB_TOKEN }} base-ref: ${{ env.last_nightly }} @@ -41,12 +41,14 @@ jobs: needs: get-changelog name: Build CIA and 3DSX Files runs-on: ubuntu-latest + permissions: + contents: write container: image: ghcr.io/z3dr/randotools:latest steps: - name: Checkout Project - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v6.0.2 - name: Run Build Script env: @@ -58,7 +60,7 @@ jobs: - if: ${{ github.event.inputs.build_type == 'Nightly' }} name: Create Pre-release - uses: ncipollo/release-action@v1.14.0 + uses: ncipollo/release-action@v1.21.0 with: token: "${{ secrets.GITHUB_TOKEN }}" artifacts: "OoT3D_Randomizer.cia,OoT3D_Randomizer.3dsx,cia.png,3dsx.png" @@ -81,7 +83,7 @@ jobs: - if: ${{ github.event.inputs.build_type == 'Release' }} name: Create Release - uses: ncipollo/release-action@v1.14.0 + uses: ncipollo/release-action@v1.21.0 with: token: "${{ secrets.GITHUB_TOKEN }}" artifacts: "OoT3D_Randomizer.cia,OoT3D_Randomizer.3dsx,cia.png,3dsx.png" From 4ce53aeaffdeb826361eb3a3b2ac9560bf909d21 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Thu, 9 Apr 2026 23:01:02 +0200 Subject: [PATCH 2/4] Refactor Deploy to Gist step --- .github/workflows/create_build.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create_build.yml b/.github/workflows/create_build.yml index 3c25c960..9f383a85 100644 --- a/.github/workflows/create_build.yml +++ b/.github/workflows/create_build.yml @@ -1,5 +1,12 @@ name: OoT3DR Builds +env: + # These are used automatically by git + GIT_AUTHOR_NAME: ${{ github.actor }} + GIT_AUTHOR_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com + GIT_COMMITTER_NAME: GitHub Actions + GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + on: workflow_dispatch: inputs: @@ -103,6 +110,7 @@ jobs: ![3DSX Download](https://github.com/${{ github.repository }}/releases/download/${{ env.tag_name }}/3dsx.png) deploy-gist: + if: ${{ github.repository == 'gamestabled/OoT3D_Randomizer' }} needs: build-cia-3dsx runs-on: ubuntu-latest steps: @@ -433,9 +441,16 @@ jobs: done - name: Deploy to Gist - uses: exuanbo/actions-deploy-gist@v1.1.4 - with: - token: ${{ secrets.TOKEN }} - gist_id: fa5ea9b42b99377c63bede1cf8ddfdad - gist_file_name: OoT3DR.unistore - file_path: ./OoT3DR.unistore + env: + GIST_ID: fa5ea9b42b99377c63bede1cf8ddfdad + GIST_FILE_NAME: OoT3DR.unistore + GIST_ACCESS_TOKEN: ${{ secrets.TOKEN }} + run: | + git clone https://$GIST_ACCESS_TOKEN@gist.github.com/$GIST_ID.git gist + cp ./$GIST_FILE_NAME ./gist/ + cd gist + git add --all + if ! git diff --cached --quiet; then + git commit -m "Update UniStore" + git push + fi From 05f14e10f5e4fde5987fa44d0ab34ce50ae2fb82 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Thu, 9 Apr 2026 23:03:30 +0200 Subject: [PATCH 3/4] Refactor Code Linting action --- .github/workflows/clang_format_code.yml | 29 ++++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/clang_format_code.yml b/.github/workflows/clang_format_code.yml index 26fb44ca..1f358819 100644 --- a/.github/workflows/clang_format_code.yml +++ b/.github/workflows/clang_format_code.yml @@ -1,5 +1,11 @@ -name: Code Linting On Push To Main and Development +name: Code Linting +env: + # These are used automatically by git + GIT_AUTHOR_NAME: ${{ github.actor }} + GIT_AUTHOR_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com + GIT_COMMITTER_NAME: GitHub Actions + GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com on: workflow_dispatch: @@ -9,8 +15,8 @@ on: - development jobs: - auto-formatter-on-main: - name: Auto Format Code and Commit If Any Changes + auto-formatter: + name: Auto Format Code runs-on: ubuntu-latest steps: @@ -24,13 +30,10 @@ jobs: style: file inplace: True - - uses: EndBug/add-and-commit@v9.1.4 - with: - committer_name: GitHub Actions - committer_email: 41898282+github-actions[bot]@users.noreply.github.com - message: | - Run automatic format script as code does not match clang format rules. - - Developers please rebase to avoid merge conflicts! - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Add and commit + run: | + git add --all + if ! git diff --cached --quiet; then + git commit -m "Auto-format code to match clang rules" + git push + fi From b32cf0ef9d4d3ab13f0a8829f8f1dcc48f3d23f6 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Thu, 9 Apr 2026 23:05:55 +0200 Subject: [PATCH 4/4] Upload artifact built during PR checks --- .github/workflows/checks.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9ebfcd28..62d2e5bc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,5 +1,12 @@ name: OoT3DR Checks +env: + # These are used automatically by git + GIT_AUTHOR_NAME: ${{ github.actor }} + GIT_AUTHOR_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com + GIT_COMMITTER_NAME: GitHub Actions + GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + on: pull_request: @@ -29,7 +36,25 @@ jobs: - name: Checkout Project uses: actions/checkout@v6.0.2 + - name: Set Env Vars + shell: bash + run: | + pr_number=$(echo ${{ github.ref }} | cut -d / -f 3) + echo pr_number="$pr_number" | tee -a $GITHUB_ENV + short_sha=${GITHUB_SHA::6} + echo short_sha="$short_sha" | tee -a $GITHUB_ENV + echo artifact_name=OoT3D_Randomizer_PR"$pr_number"_"$short_sha" | tee -a $GITHUB_ENV + - name: Compile Project + env: + GITHUB_BUILD_TYPE: "PR${{ env.pr_number }}" run: | chmod +x write_version.sh make -j + mv -v OoT3D_Randomizer.3dsx ${{ env.artifact_name }}.3dsx + + - name: Upload Artifact + uses: actions/upload-artifact@v6 + with: + name: ${{ env.artifact_name }} + path: ${{ env.artifact_name }}.3dsx