-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (115 loc) · 3.5 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build
on: [push]
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
id: create_release
build_windows:
needs: [create_release]
runs-on: windows-latest
strategy:
matrix:
triplet: [x86-windows, x64-windows]
gmod_side: [sv, cl]
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
GMOD_SIDE: ${{ matrix.gmod_side }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: lukka/[email protected]
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: c9f906558f9bb12ee9811d6edc98ec9255c6cda5
- uses: lukka/run-cmake@v10
with:
configurePreset: ninja-multi-vcpkg
buildPreset: ninja-multi-vcpkg
buildPresetAdditionalArgs: "['--config Release']"
- name: Upload release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
fail_on_unmatched_files: true
files: "builds/ninja-multi-vcpkg/bin/release/*.dll"
build_linux:
needs: [create_release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Build
run: |
set -ex
mkdir out
sudo apt-get update
sudo apt-get -y install gcc-multilib g++-multilib cmake
runbuild() {
mkdir build
pushd build
cmake ..
make -j$(nproc)
mv module/*.dll ../out
popd
rm -rf build
}
runbuild_clsv() {
export GMOD_SIDE="cl"
runbuild
export GMOD_SIDE="sv"
runbuild
}
export CFLAGS_BASE="-fPIC -s -flto -O2"
export CFLAGS="${CFLAGS_BASE}"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="${CFLAGS}"
runbuild_clsv
export CFLAGS="${CFLAGS_BASE} -m32"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="${CFLAGS}"
runbuild_clsv
- name: Upload release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
fail_on_unmatched_files: true
files: "out/*.dll"
build_macos:
needs: [create_release]
runs-on: macos-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Build
run: |
set -ex
mkdir out
runbuild() {
mkdir build
pushd build
cmake ..
make -j$(sysctl -n hw.logicalcpu)
mv module/*.dll ../out
popd
rm -rf build
}
runbuild_clsv() {
export GMOD_SIDE="cl"
runbuild
export GMOD_SIDE="sv"
runbuild
}
export CFLAGS="-fPIC -flto -O2"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="${CFLAGS}"
runbuild_clsv
- name: Upload release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
fail_on_unmatched_files: true
files: "out/*.dll"