-
Notifications
You must be signed in to change notification settings - Fork 10
102 lines (86 loc) · 3.08 KB
/
ci.yml
File metadata and controls
102 lines (86 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
pull_request:
workflow_dispatch:
# Run GitHub Actions monthly to make sure CI isn't broken and downloads don't expire
schedule:
- cron: '0 0 1 * *'
jobs:
build:
strategy:
matrix:
os:
- runs-on: windows-2022
suffix: ci-windows
- runs-on: ubuntu-22.04
suffix: ci-linux
# The type of runner that the job will run on
runs-on: ${{ matrix.os.runs-on }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3.3.0
with:
submodules: recursive
fetch-depth: 0 # Required for automatic versioning
- name: Install Ubuntu packages
if: matrix.os.runs-on == 'ubuntu-22.04'
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -y libc6:i386 linux-libc-dev:i386 ninja-build gcc-multilib g++-multilib
- name: Build release
id: build
run: |
cmake --preset github-actions
cmake --build --preset github-actions
cmake --install ${{github.workspace}}/_build/github-actions --config RelWithDebInfo --prefix ${{github.workspace}}/_build/ci-install
# Prepare artifact
- name: Prepare artifact
id: prepare_artifact
run: >
python scripts/package_target.py
--build-dir ${{github.workspace}}/_build/github-actions
--install-dir ${{github.workspace}}/_build/ci-install
--artifact-dir ${{github.workspace}}/_build/ci-artifact
--suffix ${{ matrix.os.suffix }}
# Upload result
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: ${{ steps.prepare_artifact.outputs.artifact_name }}
path: ${{github.workspace}}/_build/ci-artifact
merge-artifacts:
name: "Merge Artifacts"
needs: build
runs-on: ubuntu-latest
env:
# Must also be updated in src/game/server/CMakeLists.txt
AMXX_OFFSET_GENERATOR_VERSION: "1.0.1"
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: false # Only need scripts folder
# Download artifacts
- uses: actions/download-artifact@v4
with:
path: ${{github.workspace}}/_build/ci-artifacts
pattern: "*-ci-*"
merge-multiple: true
# Merge them
- name: Merge artifacts
id: merge_artifacts
run: >
python scripts/merge_artifacts.py
--artifact-dir ${{github.workspace}}/_build/ci-artifacts
--out-dir ${{github.workspace}}/_build/ci-out-artifact
ci-linux
ci-windows
# Upload merged artifact
- name: Upload merged artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.merge_artifacts.outputs.artifact_name }}
path: ${{github.workspace}}/_build/ci-out-artifact