Skip to content

Commit 5b8dc61

Browse files
committed
CI: Update scripts
1 parent 920d6f2 commit 5b8dc61

8 files changed

Lines changed: 85 additions & 595 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,50 @@ jobs:
1313
build:
1414
strategy:
1515
matrix:
16-
runs-on: [windows-2019, ubuntu-20.04]
16+
os:
17+
- runs-on: windows-2022
18+
suffix: ci-windows
19+
- runs-on: ubuntu-22.04
20+
suffix: ci-linux
1721

1822
# The type of runner that the job will run on
19-
runs-on: ${{ matrix.runs-on }}
23+
runs-on: ${{ matrix.os.runs-on }}
2024

2125
# Steps represent a sequence of tasks that will be executed as part of the job
2226
steps:
2327
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2428
- uses: actions/checkout@v3.3.0
2529
with:
2630
submodules: recursive
27-
28-
- name: Set up Python 3.8
29-
uses: actions/setup-python@v4.5.0
30-
with:
31-
python-version: 3.8
32-
31+
fetch-depth: 0 # Required for automatic versioning
32+
3333
- name: Install Ubuntu packages
34-
if: matrix.runs-on == 'ubuntu-20.04'
34+
if: matrix.os.runs-on == 'ubuntu-22.04'
3535
run: |
3636
sudo dpkg --add-architecture i386
3737
sudo apt update || true
38-
sudo apt install -y libc6:i386 ninja-build gcc-9-multilib g++-9-multilib libssl1.1:i386 libssl-dev:i386 zlib1g-dev:i386
38+
sudo apt install -y libc6:i386 linux-libc-dev:i386 ninja-build gcc-multilib g++-multilib
3939
4040
- name: Build release
4141
id: build
4242
run: |
43-
python ./scripts/build_release.py --build-type release --vs 2019 --toolset v141_xp --linux-compiler gcc-9 --out-dir ./_build_out --cmake-args="-DWARNINGS_ARE_ERRORS=ON" --github-actions
43+
cmake --preset github-actions
44+
cmake --build --preset github-actions
45+
cmake --install ${{github.workspace}}/_build/github-actions --config RelWithDebInfo --prefix ${{github.workspace}}/_build/ci-install
46+
47+
# Prepare artifact
48+
- name: Prepare artifact
49+
id: prepare_artifact
50+
run: >
51+
python scripts/package_target.py
52+
--build-dir ${{github.workspace}}/_build/github-actions
53+
--install-dir ${{github.workspace}}/_build/ci-install
54+
--artifact-dir ${{github.workspace}}/_build/ci-artifact
55+
--suffix ${{ matrix.os.suffix }}
4456
57+
# Upload result
4558
- name: Upload build result
46-
uses: actions/upload-artifact@v4.6.0
59+
uses: actions/upload-artifact@v4
4760
with:
48-
name: ${{ steps.build.outputs.artifact_name }}
49-
path: ./_build_out/WeaponMod-*.zip
61+
name: ${{ steps.prepare_artifact.outputs.artifact_name }}
62+
path: ${{github.workspace}}/_build/ci-artifact

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ include(InputFilesList)
1717
include(WinXPSupport)
1818
include(GitVersionSemverfier)
1919

20+
# This will be used by CI build scripts
21+
file( WRITE ${CMAKE_BINARY_DIR}/version.txt ${GIT_SEM_VERSION} )
22+
2023
project( WeaponMod VERSION "${GIT_MAJOR}.${GIT_MINOR}.${GIT_PATCH}" )
2124
include( PlatformInfo )
2225

CMakePresets.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
},
2323
{
2424
"name": "github-actions",
25-
"inherits": ["base"],
26-
"generator": "Ninja Multi-Config",
25+
"inherits": ["platform-generator", "base"],
2726
"cacheVariables": {
2827
"GNU_FORCE_COLORED_OUTPUT": false,
2928
"WARNINGS_ARE_ERRORS": true

0 commit comments

Comments
 (0)