Skip to content

Commit

Permalink
Get the right git tags for the short-hash OpenJK PR, bump checkout ac…
Browse files Browse the repository at this point in the history
…tion runner versions, set environment runners to -latest versions, update from depreciated action-automatic-releases runner
  • Loading branch information
taysta committed Oct 29, 2023
1 parent b89e19e commit 5c25d46
Showing 1 changed file with 59 additions and 15 deletions.
74 changes: 59 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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: |
Expand Down Expand Up @@ -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:
Expand All @@ -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: |
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand All @@ -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:
Expand All @@ -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: |
Expand Down

0 comments on commit 5c25d46

Please sign in to comment.