-
-
Notifications
You must be signed in to change notification settings - Fork 4
177 lines (153 loc) · 4.6 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: build
on:
pull_request:
types: [opened, reopened]
push:
paths:
- src/**
- .github/**
- build.bat
- build
jobs:
build:
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}-latest
strategy:
fail-fast: false
matrix:
config:
- name: macOS (x64)
os: macos
arch: x86_64
build: ./build
testbin: ./core/out/*/server
- name: Ubuntu (x64)
os: ubuntu
arch: x86_64
abi: gnu
cfg: |
sudo apt update
sudo apt install -y zlib1g-dev
build: ./build
testbin: ./core/out/x86_64*/server
- name: Ubuntu (x86)
os: ubuntu
arch: i686
abi: gnu
cfg: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y gcc-i686-linux-gnu zlib1g-dev:i386
build: ./build
testbin: ./core/out/i686*/server
- name: Ubuntu (arm64)
os: ubuntu
arch: aarch64
abi: gnu
hostcc: x86_64-linux-gnu-gcc
cfg: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
build: ./build
- name: Ubuntu (armv7hf)
os: ubuntu
arch: arm
abi: gnueabihf
hostcc: i686-linux-gnu-gcc
cfg: |
sudo apt update
sudo apt install -y gcc-arm-linux-gnueabihf gcc-i686-linux-gnu
build: ./build
- name: Windows (x64)
os: windows
arch: x86_64
build: .\build.bat
testbin: .\core\out\x64\server.exe
- name: Windows (x86)
os: windows
arch: x86
build: .\build.bat
testbin: .\core\out\x86\server.exe
steps:
- name: Checkout Core repo
uses: actions/checkout@v4
with:
fetch-depth: 0
path: core
- name: Checkout Base plugin
uses: actions/checkout@v4
with:
repository: igor725/cs-base
path: cs-base
- name: Checkout Survival plugin
uses: actions/checkout@v4
with:
repository: igor725/cs-survival
path: cs-survival
- name: Checkout Lua plugin
uses: actions/checkout@v4
with:
repository: igor725/cs-lua
path: cs-lua
- name: Checkout WorldEdit plugin
uses: actions/checkout@v4
with:
repository: igor725/cs-worldedit
path: cs-worldedit
- name: Checkout Web plugin
uses: actions/checkout@v4
with:
repository: igor725/cs-web
path: cs-web
- name: Detect MSVC (Windows)
uses: ilammy/msvc-dev-cmd@v1.13.0
if: ${{matrix.config.os == 'windows'}}
with:
arch: ${{matrix.config.arch}}
- name: Prebuild preparations
if: ${{matrix.config.cfg != null}}
run: ${{matrix.config.cfg}}
- name: Set environment (Linux)
if: ${{matrix.config.os == 'ubuntu'}}
run: |
echo "CSERVER_BUILD_TARGET=${{matrix.config.arch}}-linux-${{matrix.config.abi}}" >> $GITHUB_ENV
- name: Build core
working-directory: core
run: |
${{matrix.config.build}} wall noprompt
- name: Build plugins
working-directory: core
env:
HOSTCC: ${{matrix.config.hostcc}}
MACOSX_DEPLOYMENT_TARGET: "11.0"
run: |
${{matrix.config.build}} wall pb base install &&
${{matrix.config.build}} wall pb survival install &&
${{matrix.config.build}} wall pb worldedit install &&
${{matrix.config.build}} wall pb lua install &&
${{matrix.config.build}} wall pb web install wbuild
- name: Make some tests
if: ${{matrix.config.testbin != null}}
run: ${{matrix.config.testbin}} testmode
- name: Collect changes (Linux)
if: ${{matrix.config.os != 'windows'}}
working-directory: core
run: |
git log --format=medium $(git describe --tags --abbrev=0 @^)..HEAD > out/CHANGES
- name: Collect changes (Windows)
if: ${{matrix.config.os == 'windows'}}
working-directory: core
run: |
$lasttag = (git describe --tags --abbrev=0 @^) -join "`n"
Start-Process -NoNewWindow -RedirectStandardOutput out\CHANGES git.exe "log --format=medium $lasttag..HEAD"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cserver-${{matrix.config.os}}-${{matrix.config.arch}}
path: |
core/out
!core/out/**/objs
!core/out/**/worlds
!core/out/**/configs
!core/out/**/*.ilk
!core/out/**/*.exp