-
Notifications
You must be signed in to change notification settings - Fork 121
115 lines (103 loc) · 2.79 KB
/
build.yml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
push:
tags:
- '*'
branches:
- main
paths-ignore:
- LICENSE
- README.md
- 'configs**'
- '**.sln'
- '**.vcxproj**'
pull_request:
paths-ignore:
- LICENSE
- README.md
- 'configs**'
- '**.sln'
- '**.vcxproj**'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
env:
HL2SDKCS2: ${{ github.workspace }}/CS2Fixes/sdk
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
- os: ubuntu-latest
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: CS2Fixes
submodules: recursive
fetch-depth: 0
- name: Checkout Metamod
uses: actions/checkout@v4
with:
repository: alliedmodders/metamod-source
ref: master
path: mmsource-2.0
submodules: recursive
- name: Checkout AMBuild
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Install AMBuild
run: |
cd ambuild && python setup.py install && cd ..
- name: Install Clang 16
if: matrix.os == 'ubuntu-latest'
run: |
apt update && apt install -y clang-16
ln -sf /usr/bin/clang-16 /usr/bin/clang && ln -sf /usr/bin/clang++-16 /usr/bin/clang++
- name: Build
working-directory: CS2Fixes
shell: bash
run: |
mkdir build && cd build
python ../configure.py --enable-optimize --sdks cs2
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
path: CS2Fixes/build/package
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Package
run: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
ls -Rall
if [ -d "./Linux/" ]; then
cd ./Linux/
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz *
cd -
fi
if [ -d "./Windows/" ]; then
cd ./Windows/
zip -r ../${{ github.event.repository.name }}-${version}-windows.zip *
cd -
fi
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.event.repository.name }}-*
tag: ${{ github.ref }}
file_glob: true