Skip to content

Commit

Permalink
update actions to supported versions, use correct SHA for PRs
Browse files Browse the repository at this point in the history
Co-authored-by: tayst <taylor.brough13@gmail.com>
  • Loading branch information
Razish and taysta committed Feb 21, 2024
1 parent 3077056 commit 8167014
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 22 deletions.
74 changes: 52 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,21 @@ 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
uses: microsoft/setup-msbuild@v1.3.2

- name: Create Build Environment
run: cmake -E make_directory ${{ github.workspace }}/build
Expand Down Expand Up @@ -68,14 +79,14 @@ jobs:
shell: bash
run: cmake --install . --config ${{ matrix.build_type }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJK-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/build/bin/JediAcademy
if-no-files-found: error

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJO-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
Expand All @@ -93,7 +104,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 @@ -149,14 +171,14 @@ jobs:
shell: bash
run: tar -czvf OpenJO-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{github.workspace}}/install/JediAcademy/OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz
if-no-files-found: error

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJO-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
Expand All @@ -179,7 +201,18 @@ jobs:
arch: arm64

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 @@ -214,26 +247,22 @@ jobs:
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: |
chmod +x openjk.${{ matrix.arch }}.app/Contents/MacOS/openjk.${{ matrix.arch }}
tar -czvf openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
run: tar -czvf openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *

- name: Create OpenJO binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediOutcast
shell: bash
run: |
chmod +x openjo_sp.${{ matrix.arch }}.app/Contents/MacOS/openjo_sp.${{ matrix.arch }}
tar -czvf openjo_sp-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
run: tar -czvf openjo_sp-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/install/JediAcademy/openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz
if-no-files-found: error

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJO-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
Expand All @@ -245,12 +274,12 @@ jobs:
needs: [msvc, ubuntu, macos]
runs-on: ubuntu-22.04
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 binary archives
run: |
Expand All @@ -269,10 +298,11 @@ jobs:
mv ./OpenJO-macos-arm64-Release-Non-Portable/* OpenJO-macos-arm64.tar.gz
- name: Create latest build
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
generate_release_notes: true
tag_name: "latest"
prerelease: false
title: Latest Build
files: |
Expand Down Expand Up @@ -336,12 +366,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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ endif()
# ideally we would separate the hash suffix into its own variable, but sed is not available everywhere
execute_process(
COMMAND "git" "describe" "--tag"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG
RESULT_VARIABLE GIT_TAG_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down

0 comments on commit 8167014

Please sign in to comment.