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 13, 2024
1 parent e2480ca commit acf618a
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 26 deletions.
97 changes: 71 additions & 26 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 @@ -95,9 +106,23 @@ jobs:
platform: Win32
- arch: x86_64
platform: x64
exclude:
- build_type: Debug
portable: 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: Install v141_xp Toolchain
continue-on-error: true
Expand All @@ -114,7 +139,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.2

- name: Create Build Environment
run: cmake -E make_directory ${{ github.workspace }}/build
Expand Down Expand Up @@ -143,14 +168,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-windowsxp-${{ 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-windowsxp-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
Expand All @@ -168,7 +193,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 All @@ -195,6 +231,7 @@ jobs:
else
OPTIONS+=" -DUseInternalLibs=OFF -DBuildPortableVersion=OFF"
fi
if [ ${{ matrix.arch }} == "x86" ]; then
OPTIONS+=" -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/linux-i686.cmake"
fi
Expand Down Expand Up @@ -224,14 +261,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 @@ -249,7 +286,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 @@ -284,26 +332,22 @@ jobs:
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: |
chmod +x openjk.x86_64.app/Contents/MacOS/openjk.x86_64
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.x86_64.app/Contents/MacOS/openjo_sp.x86_64
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 @@ -315,12 +359,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 @@ -337,10 +381,11 @@ jobs:
mv ./OpenJO-macos-x86_64-Release-Non-Portable/* OpenJO-macos-x86_64.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 @@ -396,12 +441,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 @@ -326,6 +326,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 acf618a

Please sign in to comment.