From a5dc47d57782dd8bce49dc8e895a1c8cf2873fa8 Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:40:30 -0500 Subject: [PATCH] update workflows --- .github/workflows/cut-release.yaml | 70 +++- .github/workflows/linux-build-clang.yaml | 10 + .github/workflows/linux-build-gcc.yaml | 3 + .github/workflows/macos-build-arm.yaml | 16 +- .github/workflows/macos-build.yaml | 43 +- .github/workflows/mod-release-pipeline.yml | 427 ++++++++++++++++++++ .github/workflows/release-pipeline.yaml | 50 ++- .github/workflows/update-controller-db.yaml | 2 +- .github/workflows/windows-build-clang.yaml | 10 + .github/workflows/windows-build-msvc.yaml | 3 + 10 files changed, 600 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/mod-release-pipeline.yml diff --git a/.github/workflows/cut-release.yaml b/.github/workflows/cut-release.yaml index 2bee87515f..5612f0c5d5 100644 --- a/.github/workflows/cut-release.yaml +++ b/.github/workflows/cut-release.yaml @@ -1,4 +1,4 @@ -name: 🏭 Cut Mod Release +name: Cut Mod Release ⭐ on: workflow_dispatch: @@ -12,23 +12,69 @@ on: - patch - minor - major + binary_source: + description: 'Binary Source' + required: true + default: 'build_binaries' + type: choice + options: + - vanilla + - modbase + - build_binaries + jak1: + description: 'Supports Jak 1?' + required: true + default: 'true' + type: boolean + jak2: + description: 'Supports Jak 2?' + required: true + default: 'false' + type: boolean + jak3: + description: 'Supports Jak 3?' + required: true + default: 'false' + type: boolean + jakx: + description: 'Supports Jak X?' + required: true + default: 'false' + type: boolean permissions: contents: write jobs: - cut_release: - name: "Cut Release" - uses: open-goal/mod-bundling-tools/.github/workflows/mod-bundler.yml@v1 + prep_vars: + name: "Prep Variables" + runs-on: ubuntu-latest + outputs: + supported_games: ${{ steps.prep-vars.outputs.GAMES }} + tooling_repo: ${{ steps.prep-vars.outputs.REPO }} + steps: + - name: Prep Variables + id: prep-vars + run: | + GAMES= + if [[ ${{ inputs.jak1 }} == "true" ]]; then GAMES+=jak1,; fi + if [[ ${{ inputs.jak2 }} == "true" ]]; then GAMES+=jak2,; fi + if [[ ${{ inputs.jak3 }} == "true" ]]; then GAMES+=jak3,; fi + if [[ ${{ inputs.jakx }} == "true" ]]; then GAMES+=jakx,; fi + GAMES=${GAMES%?} + echo "GAMES=$GAMES" >> $GITHUB_OUTPUT + REPO=OpenGOAL-Mods/OG-Mod-Base + if [[ ${{ inputs.binary_source == 'vanilla' }} ]]; then REPO=open-goal/jak-project; fi + echo "REPO=$REPO" >> $GITHUB_OUTPUT + + cut_mod_release: + name: "Cut Mod Release" + needs: prep_vars + uses: ./.github/workflows/mod-release-pipeline.yml with: semverBump: ${{ inputs.bump }} - metadataName: "MicroTransactions" - metadataDescription: "Unlock Jak's moveset with orbs!" - metadataSupportedGames: "jak1" - metadataAuthors: "HimHam,barg" - metadataTags: "challenge,gameplay-mod" - metadataWebsiteUrl: "https://github.com/OpenGOAL-Mods/OG-Microtransactions" - toolingRepo: "OpenGOAL-Mods/OG-Mod-Base" - gameAssetsDir: "game/assets" + metadataSupportedGames: ${{ needs.prep_vars.outputs.supported_games }} + buildBinaries: ${{ inputs.binary_source == 'build_binaries'}} + toolingRepo: ${{ needs.prep_vars.outputs.tooling_repo }} secrets: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux-build-clang.yaml b/.github/workflows/linux-build-clang.yaml index b00c1fbc45..53a282a6b7 100644 --- a/.github/workflows/linux-build-clang.yaml +++ b/.github/workflows/linux-build-clang.yaml @@ -21,9 +21,19 @@ jobs: timeout-minutes: 60 steps: + # minimal checkout if we're NOT uploading artifacts - name: Checkout Repository + if: ${{ ! inputs.uploadArtifacts }} uses: actions/checkout@v4 + # full checkout with tags if we ARE uploading artifacts + - name: Checkout Repository with Tags + if: ${{ inputs.uploadArtifacts }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - name: Install Package Dependencies run: | sudo apt update diff --git a/.github/workflows/linux-build-gcc.yaml b/.github/workflows/linux-build-gcc.yaml index b2528c3b32..57a8af81e5 100644 --- a/.github/workflows/linux-build-gcc.yaml +++ b/.github/workflows/linux-build-gcc.yaml @@ -19,6 +19,9 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Install Package Dependencies run: | diff --git a/.github/workflows/macos-build-arm.yaml b/.github/workflows/macos-build-arm.yaml index 032dd27fb2..63f6c1619c 100644 --- a/.github/workflows/macos-build-arm.yaml +++ b/.github/workflows/macos-build-arm.yaml @@ -13,25 +13,25 @@ on: jobs: build: name: ARM - runs-on: macos-12 + runs-on: macos-15 timeout-minutes: 120 steps: - name: Checkout Repository uses: actions/checkout@v4 - - - name: Set up ARM64 environment - run: sudo softwareupdate --install-rosetta --agree-to-license + with: + fetch-depth: 0 + fetch-tags: true - name: Install Package Dependencies - run: arch -arm64 brew install cmake ninja + run: brew install cmake ninja nasm - name: Setup sccache uses: hendrikmuhs/ccache-action@v1.2.14 with: variant: sccache - key: macos-12-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }} - restore-keys: macos-12-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }} + key: macos-15-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }} + restore-keys: macos-15-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }} max-size: 1000M - name: CMake Generation @@ -52,7 +52,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: opengoal-macos-${{ inputs.cachePrefix }} + name: opengoal-macos-arm-${{ inputs.cachePrefix }} if-no-files-found: error path: | ./build/goalc/goalc diff --git a/.github/workflows/macos-build.yaml b/.github/workflows/macos-build.yaml index 861fb376a0..d64d2065d3 100644 --- a/.github/workflows/macos-build.yaml +++ b/.github/workflows/macos-build.yaml @@ -17,12 +17,49 @@ on: jobs: build: name: Intel - runs-on: macos-12 + runs-on: macos-13 timeout-minutes: 120 steps: + # minimal checkout if we're NOT uploading artifacts - name: Checkout Repository + if: ${{ ! inputs.uploadArtifacts }} uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + # full checkout with tags if we ARE uploading artifacts + - name: Checkout Repository with Tags + if: ${{ inputs.uploadArtifacts }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + # full checkout with tags if we ARE uploading artifacts + - name: Checkout Repository with Tags + if: ${{ inputs.uploadArtifacts }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + # full checkout with tags if we ARE uploading artifacts + - name: Checkout Repository with Tags + if: ${{ inputs.uploadArtifacts }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + # full checkout with tags if we ARE uploading artifacts + - name: Checkout Repository with Tags + if: ${{ inputs.uploadArtifacts }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Install Package Dependencies run: brew install cmake nasm ninja @@ -31,8 +68,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.14 with: variant: sccache - key: macos-12-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }} - restore-keys: macos-12-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }} + key: macos-13-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}-${{ github.sha }} + restore-keys: macos-13-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }} max-size: 1000M - name: CMake Generation diff --git a/.github/workflows/mod-release-pipeline.yml b/.github/workflows/mod-release-pipeline.yml new file mode 100644 index 0000000000..fc7ea524a8 --- /dev/null +++ b/.github/workflows/mod-release-pipeline.yml @@ -0,0 +1,427 @@ +name: "Mod Release Pipeline" +on: + workflow_call: + inputs: + metadataSupportedGames: + description: "The supported games for the mod, can be comma-separated, supports `jak1|jak2|jak3|jakx`" + required: true + default: "jak4" + type: "string" + outputDir: + description: "The directory that the releases assets are created and temporarily stored in. Defaults to `./bundler`" + required: false + default: "./bundler" + type: "string" + semverBump: + description: "What semver bump to use - patch|minor|major. Defaults to patch" + required: false + default: "patch" + type: "string" + releaseBranches: + description: "Comma separated list of branches (JavaScript regular expression accepted) that will generate the release tags. You probably want your default branch in this list." + required: false + default: "master,main" + type: "string" + buildBinaries: + description: "Whether to build binaries from source. Defaults to `false`, pulling binaries from `toolingRepo` instead." + required: false + default: false + type: "boolean" + toolingRepo: + description: "The repository from which the tooling is taken for the bundle. Defaults to open-goal/jak-project." + required: false + default: "open-goal/jak-project" + type: "string" + toolingVersion: + description: "The version of `toolingRepo` to bundle. Defaults to latest version." + required: false + default: "latest" + type: "string" + skipWindows: + description: "Whether to skip Windows builds, defaults to `false`" + required: false + default: false + type: "boolean" + skipLinux: + description: "Whether to skip Linux builds, defaults to `false`" + required: false + default: false + type: "boolean" + skipMacOS: + description: "Whether to skip macOS builds, defaults to `false`" + required: false + default: false + type: "boolean" + secrets: + token: + description: "GitHub token used to create the release and push assets to it." + required: true + outputs: + taggedVersion: + description: "The version that was tagged and pushed for the mod" + value: ${{ jobs.create_release.outputs.bundleTagName }} + +permissions: + contents: write + +jobs: + validate_metadata: + name: "Validate Metadata" + runs-on: ubuntu-latest + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: "Create metadata.json" + env: + SCHEMA_VERSION: "0.1.0" + VERSION: "v0.0.0" + SUPPORTED_GAMES: ${{ inputs.metadataSupportedGames }} + OUT_DIR: "/tmp" + run: | + python ./.github/scripts/create-mod-release/emit-metadata.py + + - name: "Validating Metadata" + run: | + npm install -g ajv-cli + ajv validate -s ./.github/schemas/mods/v2/mod-schema.v2.json -d /tmp/metadata.json + + create_release: + name: "Create Release" + needs: + - validate_metadata + runs-on: ubuntu-latest + outputs: + bundleTagName: ${{ steps.tag_version.outputs.new_tag }} + steps: + - name: Bump Version and Push Tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.token }} + tag_prefix: v + default_bump: ${{ inputs.semverBump }} + release_branches: ${{ inputs.releaseBranches }} + + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.token }} + run: gh release create ${{ steps.tag_version.outputs.new_tag }} --generate-notes --draft --repo ${{ github.repository }} + + # if `buildBinaries`, run the workflow to build and generate artifacts + + build_windows_clang: + name: "Windows Build" + needs: create_release + if: ${{ !inputs.skipWindows && inputs.buildBinaries }} + # assumes that this file is defined in your mod repo + uses: ./.github/workflows/windows-build-clang.yaml + with: + cmakePreset: "Release-windows-clang-static" + cachePrefix: "static" + uploadArtifacts: true + secrets: inherit + + bundle_windows_build: + name: "Bundle Windows Build" + needs: + - create_release + - build_windows_clang + if: ${{ !inputs.skipWindows && inputs.buildBinaries }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.create_release.outputs.bundleTagName }} + + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: Prepare Artifact Folder + run: mkdir -p ./ci-artifacts + + - uses: actions/download-artifact@v4 + name: Download all Artifacts + with: + path: ./ci-artifacts/ + + - name: Display structure of downloaded files + run: ls -Rl ./ci-artifacts/ + + - name: Prepare Windows Build Assets + run: | + mkdir -p ./ci-artifacts/windows + mkdir -p ${{ inputs.outputDir }}/dist + chmod +x ./.github/scripts/releases/extract_mod_build_windows.sh + ./.github/scripts/releases/extract_mod_build_windows.sh ./ci-artifacts/windows ./ci-artifacts/opengoal-windows-static ./ + TAG_VAL=${{ needs.create_release.outputs.bundleTagName }} + 7z a -tzip ${{ inputs.outputDir }}/dist/windows-${TAG_VAL}.zip ./ci-artifacts/windows/* + + - name: Upload Bundle + uses: actions/upload-artifact@v4 + with: + name: windows + if-no-files-found: error + path: ${{ inputs.outputDir }}/dist + + build_linux_clang: + name: "Linux Build" + needs: create_release + if: ${{ !inputs.skipLinux && inputs.buildBinaries }} + # assumes that this file is defined in your mod repo + uses: ./.github/workflows/linux-build-clang.yaml + with: + cmakePreset: "Release-linux-clang-static" + cachePrefix: "static" + uploadArtifacts: true + secrets: inherit + + bundle_linux_build: + name: "Bundle Linux Build" + needs: + - create_release + - build_linux_clang + if: ${{ !inputs.skipLinux && inputs.buildBinaries }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.create_release.outputs.bundleTagName }} + + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: Prepare Artifact Folder + run: mkdir -p ./ci-artifacts + + - uses: actions/download-artifact@v4 + name: Download all Artifacts + with: + path: ./ci-artifacts/ + + - name: Display structure of downloaded files + run: ls -Rl ./ci-artifacts/ + + - name: Prepare Linux Build Assets + run: | + mkdir -p ./ci-artifacts/linux + mkdir -p ${{ inputs.outputDir }}/dist + chmod +x ./.github/scripts/releases/extract_mod_build_unix.sh + ./.github/scripts/releases/extract_mod_build_unix.sh ./ci-artifacts/linux ./ci-artifacts/opengoal-linux-static ./ + pushd ci-artifacts/linux + TAG_VAL=${{ needs.create_release.outputs.bundleTagName }} + tar czf ../../${{ inputs.outputDir }}/dist/linux-${TAG_VAL}.tar.gz . + popd + + - name: Upload Bundle + uses: actions/upload-artifact@v4 + with: + name: linux + if-no-files-found: error + path: ${{ inputs.outputDir }}/dist + + build_macos_intel: + name: "MacOS Build" + needs: create_release + if: ${{ !inputs.skipMacOS && inputs.buildBinaries }} + # assumes that this file is defined in your mod repo + uses: ./.github/workflows/macos-build.yaml + with: + cmakePreset: "Release-macos-x86_64-clang-static" + cachePrefix: "static" + uploadArtifacts: true + secrets: inherit + + bundle_macos_build: + name: "Bundle MacOS Build" + needs: + - create_release + - build_macos_intel + if: ${{ !inputs.skipMacOS && inputs.buildBinaries }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.create_release.outputs.bundleTagName }} + + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: Prepare Artifact Folder + run: mkdir -p ./ci-artifacts + + - uses: actions/download-artifact@v4 + name: Download all Artifacts + with: + path: ./ci-artifacts/ + + - name: Display structure of downloaded files + run: ls -Rl ./ci-artifacts/ + + - name: Prepare MacOS Build Assets + run: | + mkdir -p ./ci-artifacts/macos-intel + mkdir -p ${{ inputs.outputDir }}/dist + chmod +x ./.github/scripts/releases/extract_mod_build_unix.sh + ./.github/scripts/releases/extract_mod_build_unix.sh ./ci-artifacts/macos-intel ./ci-artifacts/opengoal-macos-static ./ + pushd ci-artifacts/macos-intel + TAG_VAL=${{ needs.create_release.outputs.bundleTagName }} + tar czf ../../${{ inputs.outputDir }}/dist/macos-intel-${TAG_VAL}.tar.gz . + popd + + - name: Upload Bundle + uses: actions/upload-artifact@v4 + with: + name: macos-intel + if-no-files-found: error + path: ${{ inputs.outputDir }}/dist + + # if not `buildBinaries`, run the steps to build release assets + + bundle_windows_no_build: + name: "Bundle Windows (no build)" + needs: create_release + if: ${{ !inputs.skipWindows && !inputs.buildBinaries }} + runs-on: ubuntu-latest + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: "Create Windows Release" + env: + outputDir: ${{ inputs.outputDir }} + versionName: ${{ needs.create_release.outputs.bundleTagName }} + toolingRepo: ${{ inputs.toolingRepo }} + toolingVersion: ${{ inputs.toolingVersion }} + run: python ./.github/scripts/create-mod-release/bundle-windows.py + + - name: Upload Bundle + uses: actions/upload-artifact@v4 + with: + name: windows + if-no-files-found: error + path: ${{ inputs.outputDir }}/dist + + bundle_linux_no_build: + name: "Bundle Linux (no build)" + needs: create_release + if: ${{ !inputs.skipLinux && !inputs.buildBinaries }} + runs-on: ubuntu-latest + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: "Create Linux Release" + env: + outputDir: ${{ inputs.outputDir }} + versionName: ${{ needs.create_release.outputs.bundleTagName }} + toolingRepo: ${{ inputs.toolingRepo }} + toolingVersion: ${{ inputs.toolingVersion }} + run: python ./.github/scripts/create-mod-release/bundle-linux.py + + - name: Upload Bundle + uses: actions/upload-artifact@v4 + with: + name: linux + if-no-files-found: error + path: ${{ inputs.outputDir }}/dist + + bundle_macos_no_build: + name: "Bundle macOS Intel (no build)" + needs: create_release + if: ${{ !inputs.skipMacOS && !inputs.buildBinaries }} + runs-on: ubuntu-latest + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: "Create MacOS Intel Release" + env: + outputDir: ${{ inputs.outputDir }} + versionName: ${{ needs.create_release.outputs.bundleTagName }} + toolingRepo: ${{ inputs.toolingRepo }} + toolingVersion: ${{ inputs.toolingVersion }} + run: python ./.github/scripts/create-mod-release/bundle-macos.py + + - name: Upload Bundle + uses: actions/upload-artifact@v4 + with: + name: macos-intel + if-no-files-found: error + path: ${{ inputs.outputDir }}/dist + + finalize_release: + name: "Finalize Release" + needs: + - create_release + - bundle_windows_build + - bundle_linux_build + - bundle_macos_build + - bundle_windows_no_build + - bundle_linux_no_build + - bundle_macos_no_build + if: | + always() && + needs.create_release.result == 'success' && + (needs.bundle_windows_build.result == 'skipped' || needs.bundle_windows_build.result == 'success') && + (needs.bundle_linux_build.result == 'skipped' || needs.bundle_linux_build.result == 'success') && + (needs.bundle_macos_build.result == 'skipped' || needs.bundle_macos_build.result == 'success') && + (needs.bundle_windows_no_build.result == 'skipped' || needs.bundle_windows_no_build.result == 'success') && + (needs.bundle_linux_no_build.result == 'skipped' || needs.bundle_linux_no_build.result == 'success') && + (needs.bundle_macos_no_build.result == 'skipped' || needs.bundle_macos_no_build.result == 'success') + runs-on: ubuntu-latest + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + + - name: Prepare Output Folder + run: mkdir -p ${{ inputs.outputDir }}/dist + + - name: Download all Artifacts + uses: actions/download-artifact@v4 + with: + path: ${{ inputs.outputDir }}/artifacts + + - name: Display structure of downloaded files + run: ls -Rl ${{ inputs.outputDir }} + + - name: Move Linux Assets + if: ${{ !inputs.skipLinux }} + run: mv ${{ inputs.outputDir }}/artifacts/linux/* ${{ inputs.outputDir }}/dist + + - name: Move Windows Assets + if: ${{ !inputs.skipWindows }} + run: mv ${{ inputs.outputDir }}/artifacts/windows/* ${{ inputs.outputDir }}/dist + + - name: Move MacOS Assets + if: ${{ !inputs.skipMacOS }} + run: mv ${{ inputs.outputDir }}/artifacts/macos-intel/* ${{ inputs.outputDir }}/dist + + - name: Prepare Release Metadata + env: + SCHEMA_VERSION: "0.1.0" + VERSION: ${{ needs.create_release.outputs.bundleTagName }} + SUPPORTED_GAMES: ${{ inputs.metadataSupportedGames }} + OUT_DIR: "${{ inputs.outputDir }}/dist" + run: python ./.github/scripts/create-mod-release/emit-metadata.py + + - name: Validating Metadata + run: | + npm install -g ajv-cli + ajv validate -s ./.github/schemas/mods/v2/mod-schema.v2.json -d ${{ inputs.outputDir }}/dist/metadata.json + + - name: Upload Assets + env: + GITHUB_TOKEN: ${{ secrets.token }} + run: | + TAG_VAL=${{ needs.create_release.outputs.bundleTagName }} + echo $TAG_VAL + gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/${{ inputs.outputDir }}/dist/* --repo ${{ github.repository }} --clobber + + - name: Publish Release + env: + GITHUB_TOKEN: ${{ secrets.token }} + run: | + TAG_VAL=${{ needs.create_release.outputs.bundleTagName }} + echo $TAG_VAL + gh release edit ${TAG_VAL} --draft=false --repo ${{ github.repository }} diff --git a/.github/workflows/release-pipeline.yaml b/.github/workflows/release-pipeline.yaml index 06c2739149..0ed5663907 100644 --- a/.github/workflows/release-pipeline.yaml +++ b/.github/workflows/release-pipeline.yaml @@ -17,7 +17,7 @@ permissions: contents: write jobs: - cut-release: + cut_release: name: Cut Release runs-on: ubuntu-latest outputs: @@ -45,6 +45,8 @@ jobs: # Windows build_windows_clang: + needs: + - cut_release name: "🖥️ Windows" uses: ./.github/workflows/windows-build-clang.yaml with: @@ -55,6 +57,8 @@ jobs: # Linux build_linux_clang: + needs: + - cut_release name: "🐧 Linux" uses: ./.github/workflows/linux-build-clang.yaml with: @@ -65,27 +69,42 @@ jobs: # macOS build_macos_intel: + needs: + - cut_release name: "🍎 MacOS" uses: ./.github/workflows/macos-build.yaml with: - cmakePreset: "Release-macos-clang-static" + cmakePreset: "Release-macos-x86_64-clang-static" cachePrefix: "static" uploadArtifacts: true secrets: inherit + build_macos_arm: + needs: + - cut_release + name: "🍎 MacOS" + uses: ./.github/workflows/macos-build.yaml + with: + cmakePreset: "Release-macos-x86_64-clang-static" + cachePrefix: "static-arm" + uploadArtifacts: true + secrets: inherit + # Upload the Artifacts upload_artifacts: needs: - - cut-release + - cut_release - build_windows_clang - build_linux_clang - build_macos_intel + - build_macos_arm name: "Upload Artifacts" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: ${{ needs.cut-release.outputs.new_tag }} + fetch-tags: true + fetch-depth: 0 - name: Prepare Artifact Folder run: mkdir -p ./ci-artifacts/final @@ -103,7 +122,7 @@ jobs: mkdir -p ./ci-artifacts/linux ./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/linux ./ci-artifacts/opengoal-linux-static ./ pushd ci-artifacts/linux - TAG_VAL=${{ needs.cut-release.outputs.new_tag }} + TAG_VAL=${{ needs.cut_release.outputs.new_tag }} tar czf ../final/opengoal-linux-${TAG_VAL}.tar.gz . popd chmod +x ./ci-artifacts/opengoal-linux-static/lsp/lsp @@ -113,29 +132,40 @@ jobs: run: | mkdir -p ./ci-artifacts/windows ./.github/scripts/releases/extract_build_windows.sh ./ci-artifacts/windows ./ci-artifacts/opengoal-windows-static ./ - TAG_VAL=${{ needs.cut-release.outputs.new_tag }} + TAG_VAL=${{ needs.cut_release.outputs.new_tag }} 7z a -tzip ./ci-artifacts/final/opengoal-windows-${TAG_VAL}.zip ./ci-artifacts/windows/* cp ./ci-artifacts/opengoal-windows-static/lsp.exe ./ci-artifacts/final/opengoal-lsp-windows-${TAG_VAL}.exe - - name: Prepare macOS Build Assets + - name: Prepare Intel macOS Build Assets run: | mkdir -p ./ci-artifacts/macos ./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/macos ./ci-artifacts/opengoal-macos-static ./ pushd ci-artifacts/macos - TAG_VAL=${{ needs.cut-release.outputs.new_tag }} + TAG_VAL=${{ needs.cut_release.outputs.new_tag }} tar czf ../final/opengoal-macos-intel-${TAG_VAL}.tar.gz . popd chmod +x ./ci-artifacts/opengoal-macos-static/lsp/lsp cp ./ci-artifacts/opengoal-macos-static/lsp/lsp ./ci-artifacts/final/opengoal-lsp-macos-intel-${TAG_VAL}.bin + - name: Prepare ARM macOS Build Assets + run: | + mkdir -p ./ci-artifacts/macos-arm + ./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/macos-arm ./ci-artifacts/opengoal-macos-static-arm ./ + pushd ci-artifacts/macos-arm + TAG_VAL=${{ needs.cut_release.outputs.new_tag }} + tar czf ../final/opengoal-macos-arm-${TAG_VAL}.tar.gz . + popd + chmod +x ./ci-artifacts/opengoal-macos-static-arm/lsp/lsp + cp ./ci-artifacts/opengoal-macos-static-arm/lsp/lsp ./ci-artifacts/final/opengoal-lsp-macos-arm-${TAG_VAL}.bin + - name: Upload Assets env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release upload ${{ needs.cut-release.outputs.new_tag }} ${{ github.WORKSPACE }}/ci-artifacts/final/* --repo ${{ github.repository }} --clobber + gh release upload ${{ needs.cut_release.outputs.new_tag }} ${{ github.WORKSPACE }}/ci-artifacts/final/* --repo ${{ github.repository }} --clobber - name: Publish Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release edit ${{ needs.cut-release.outputs.new_tag }} --draft=false --repo ${{ github.repository }} + gh release edit ${{ needs.cut_release.outputs.new_tag }} --draft=false --repo ${{ github.repository }} diff --git a/.github/workflows/update-controller-db.yaml b/.github/workflows/update-controller-db.yaml index 705cd04fb5..3f1c0a2776 100644 --- a/.github/workflows/update-controller-db.yaml +++ b/.github/workflows/update-controller-db.yaml @@ -19,7 +19,7 @@ jobs: wget -O ./game/assets/sdl_controller_db.txt https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.BOT_PAT }} author: 'OpenGOALBot ' diff --git a/.github/workflows/windows-build-clang.yaml b/.github/workflows/windows-build-clang.yaml index 0eafd2818e..d14669ea48 100644 --- a/.github/workflows/windows-build-clang.yaml +++ b/.github/workflows/windows-build-clang.yaml @@ -22,9 +22,19 @@ jobs: timeout-minutes: 60 steps: + # minimal checkout if we're NOT uploading artifacts - name: Checkout Repository + if: ${{ ! inputs.uploadArtifacts }} uses: actions/checkout@v4 + # full checkout with tags if we ARE uploading artifacts + - name: Checkout Repository with Tags + if: ${{ inputs.uploadArtifacts }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - name: Install NASM # TODO - Simplify this with just the first command once choco 2.0 rolls out everywhere run: | diff --git a/.github/workflows/windows-build-msvc.yaml b/.github/workflows/windows-build-msvc.yaml index 79b960d454..3277d0f2ba 100644 --- a/.github/workflows/windows-build-msvc.yaml +++ b/.github/workflows/windows-build-msvc.yaml @@ -19,6 +19,9 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Install NASM # TODO - Simplify this with just the first command once choco 2.0 rolls out everywhere