-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: building job was universialised for using same code on both OS
- Loading branch information
1 parent
02d2d08
commit 5e829fb
Showing
1 changed file
with
15 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
- 'documentation/**' | ||
|
||
jobs: | ||
build-windows: | ||
build-generic: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
|
@@ -21,7 +21,10 @@ jobs: | |
cmake_preset: windows-x64-debug | ||
build_conf: Debug | ||
devenv_arch: amd64 | ||
|
||
- os: ubuntu-22.04 | ||
cmake_preset: linux-x64-debug | ||
build_conf: Debug | ||
devenv_arch: none | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
@@ -35,9 +38,17 @@ jobs: | |
run: cmake -E make_directory ${{ github.workspace }}/build | ||
|
||
- uses: ilammy/[email protected] | ||
if: runner.os == 'Windows' | ||
with: | ||
arch: ${{ matrix.devenv_arch }} | ||
|
||
- name: Install Linux-specific dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-multilib g++-multilib cmake | ||
sudo apt-get install qtbase5-dev | ||
- name: Install ninja-build tool | ||
uses: seanmiddleditch/gha-setup-ninja@v4 | ||
|
||
|
@@ -60,68 +71,8 @@ jobs: | |
mkdir -p publish/primext/bin | ||
mkdir -p publish/primext/devkit | ||
cp -r build/${{ matrix.build_conf }}/primext/* publish/primext/ | ||
cp build/${{ matrix.build_conf }}/primext_run publish/ | ||
cp -r game_dir/* publish/primext | ||
pushd publish | ||
zip -r ../artifacts/primext-${{ matrix.cmake_preset }}.zip ./* | ||
popd | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact-${{ matrix.cmake_preset }} | ||
path: artifacts/* | ||
|
||
build-linux: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-22.04 | ||
cmake_preset: linux-x64-debug | ||
build_conf: Debug | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Create build environment | ||
# Some projects don't allow in-source building, so create a separate build directory | ||
# We'll use this as our working directory for all subsequent commands | ||
run: cmake -E make_directory ${{ github.workspace }}/build | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-multilib g++-multilib cmake ninja-build | ||
sudo apt-get install qtbase5-dev | ||
- name: Configure CMake | ||
# Use a bash shell so we can use the same syntax for environment variable | ||
# access regardless of the host operating system | ||
shell: bash | ||
working-directory: ${{ github.workspace }}/build | ||
# Note the current convention is to use the -S and -B options here to specify source | ||
# and build directories, but this is only available with CMake 3.13 and higher. | ||
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | ||
run: cmake $GITHUB_WORKSPACE --preset ${{ matrix.cmake_preset }} | ||
|
||
- name: Build | ||
working-directory: ${{ github.workspace }}/build | ||
shell: bash | ||
# Execute the build. You can specify a specific target with "--target <NAME>" | ||
run: cmake --build . --config ${{ matrix.build_conf }} --parallel 8 | ||
|
||
- name: Prepare artifacts | ||
run: | | ||
mkdir artifacts/ | ||
mkdir -p publish/primext/bin | ||
mkdir -p publish/primext/devkit | ||
cp -r build/${{ matrix.build_conf }}/primext/* publish/primext/ | ||
cp build/${{ matrix.build_conf }}/primext_run publish/ | ||
cp build/${{ matrix.build_conf }}/primext_run publish/ || true | ||
cp build/${{ matrix.build_conf }}/primext.exe publish/ || true | ||
cp -r game_dir/* publish/primext | ||
pushd publish | ||
zip -r ../artifacts/primext-${{ matrix.cmake_preset }}.zip ./* | ||
|