-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (141 loc) · 4.17 KB
/
ci.yml
File metadata and controls
154 lines (141 loc) · 4.17 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Continuous Integration
on:
push:
tags:
- '*'
branches:
- '*'
paths-ignore:
- generator_scripts/**
- README.md
- LICENSE
- .gitignore
pull_request:
branches:
- master
paths-ignore:
- generator_scripts/**
- README.md
- LICENSE
- .gitignore
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
os_short: windows
compiler_cc: msvc-vs2022
sdks: '["cs2", "dota", "deadlock"]'
- os: ubuntu-latest
os_short: linux
compiler_cc: clang
compiler_cxx: clang++
sdks: '["cs2", "dota"]'
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
fail-fast: false
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}
env:
HL2SDKROOT: ${{ github.workspace }}/
HL2SDKMANIFESTS: ${{ github.workspace }}/hl2sdk-manifests/
MMSOURCE20: ${{ github.workspace }}/metamod-source/
steps:
- name: Checkout SchemaDump
uses: actions/checkout@v4
with:
path: schemadump
- name: Checkout Metamod-Source
uses: actions/checkout@v4
with:
repository: alliedmodders/metamod-source
submodules: recursive
path: metamod-source
- name: Checkout hl2sdk-manifests
uses: actions/checkout@v4
with:
repository: alliedmodders/hl2sdk-manifests
path: hl2sdk-manifests
- name: Checkout hl2sdk-cs2
uses: actions/checkout@v4
with:
repository: alliedmodders/hl2sdk
path: hl2sdk-cs2
ref: cs2
- name: Checkout hl2sdk-dota
uses: actions/checkout@v4
with:
repository: alliedmodders/hl2sdk
path: hl2sdk-dota
ref: dota
- name: Checkout hl2sdk-deadlock
uses: actions/checkout@v4
with:
repository: alliedmodders/hl2sdk
path: hl2sdk-deadlock
ref: deadlock
- name: Checkout AMBuild
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Install AMBuild win
if: matrix.os == 'windows-latest'
run: |
cd ambuild && python -m pip install . && cd ..
- name: Install AMBuild linux
if: matrix.os == 'ubuntu-latest'
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
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
${{ matrix.compiler_cc }} --version
${{ matrix.compiler_cxx }} --version
- name: Build
working-directory: schemadump
run: |
mkdir build
cd build
python ../configure.py --enable-optimize --sdks=${{ join(fromJSON(matrix.sdks)) }}
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: schemadump-${{ matrix.os_short }}
path: schemadump/build/package
release:
name: Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Package
run: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
oses="linux windows"
sdks="cs2 dota deadlock"
for os in $oses; do
for sdk in $sdks; do
if [ -d "./schemadump-$os/$sdk" ]; then
echo "Packaging $os-$sdk..."
cd ./schemadump-$os/$sdk
zip -r ../../schemadump-$sdk-$os-${version}.zip ./*
cd -
fi
done
done
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
schemadump-*.zip