From 5c25d46a8a547d6f857c5ecab1e60bb5cf59b7a6 Mon Sep 17 00:00:00 2001 From: taysta Date: Sun, 29 Oct 2023 15:07:05 +0800 Subject: [PATCH] Get the right git tags for the short-hash OpenJK PR, bump checkout action runner versions, set environment runners to -latest versions, update from depreciated action-automatic-releases runner --- .github/workflows/build.yml | 74 +++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1d035730d..a3aec7a38b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ on: jobs: msvc: name: Windows ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }}) - runs-on: windows-2022 + runs-on: windows-latest strategy: matrix: arch: [x86, x86_64] @@ -35,7 +35,18 @@ jobs: platform: x64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 @@ -74,7 +85,7 @@ jobs: msvcxp: name: WinXP ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }}) - runs-on: windows-2022 + runs-on: windows-latest strategy: matrix: arch: [x86, x86_64] @@ -87,7 +98,18 @@ jobs: platform: x64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Install v141_xp Toolchain continue-on-error: true @@ -104,7 +126,7 @@ jobs: Write-Host "components were not installed" } - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v1.3.1 - name: Create Build Environment run: cmake -E make_directory ${{ runner.workspace }}/build @@ -141,7 +163,7 @@ jobs: ubuntu: name: Ubuntu ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }}) - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -150,7 +172,18 @@ jobs: portable: [Non-Portable] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Create Build Environment run: | @@ -215,7 +248,7 @@ jobs: macos: name: macOS ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable}}) - runs-on: macos-12 + runs-on: macos-latest strategy: fail-fast: false matrix: @@ -224,7 +257,18 @@ jobs: portable: [Non-Portable] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Create Build Environment run: | @@ -271,9 +315,9 @@ jobs: create-latest: if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: [msvc, ubuntu, macos] - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -289,7 +333,7 @@ jobs: mv ./OpenJK-macos-x86_64-Release-Non-Portable/* OpenJK-macos-x86_64.tar.gz - name: Create latest build - uses: marvinpinto/action-automatic-releases@latest + uses: ModeSevenIndustrialSolutions/action-automatic-releases@latest with: repo_token: ${{ secrets.GITHUB_TOKEN }} automatic_release_tag: "latest" @@ -302,7 +346,7 @@ jobs: create-release: if: github.event_name == 'release' needs: [msvc, ubuntu, macos] - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: @@ -328,12 +372,12 @@ jobs: zip: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Create archive run: |