-
-
Notifications
You must be signed in to change notification settings - Fork 76
252 lines (211 loc) · 9.41 KB
/
Copy pathlinux_server_build.yml
File metadata and controls
252 lines (211 loc) · 9.41 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Copyright 2013-2019 High Fidelity, Inc.
# Copyright 2020-2022 Vircadia contributors.
# Copyright 2021-2025 Overte e.V.
# SPDX-License-Identifier: Apache-2.0
name: Linux Server CI Build
# Keep in mind that GitHub Actions does not allow reading secrets during PR builds.
on:
pull_request:
types: [labeled]
push:
tags:
# Release tags. E.g. 2024.06.1
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- "[0-9][0-9][0-9][0-9].[0-9][0-9].**"
env:
BUILD_TYPE: Release
UPLOAD_BUCKET: overte-public
UPLOAD_REGION: fra1
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
CMAKE_BUILD_EXTRA: --preset conan-release
jobs:
build:
# Only run master or tagged builds, or PRs when labeled as "server"
if: github.event.label.name == 'server'|| github.event_name != 'pull_request'
name: "${{matrix.os}}, ${{matrix.arch}}"
strategy:
matrix:
include:
- os: debian-12
image: docker.io/overte/overte-server-build:2026-02-09-debian-12-amd64 # Container image used for building. Built from /tools/ci-script/deb_package/Dockerfile_x
arch: amd64
qt_source: system # Which Qt Conan package to use. `system`, `source`, or `aqt`.
runner: ubuntu-latest # Which GitHub Actions Runner to use. When using `image` this just needs to run the build container.
- os: debian-12
image: docker.io/overte/overte-server-build:2026-02-09-debian-12-aarch64
arch: aarch64
qt_source: system
runner: ubuntu-24.04-arm
- os: debian-13
image: docker.io/overte/overte-server-build:2026-02-09-debian-13-amd64
arch: amd64
qt_source: system
runner: ubuntu-latest
- os: debian-13
image: docker.io/overte/overte-server-build:2026-02-09-debian-13-aarch64
arch: aarch64
qt_source: system
runner: ubuntu-24.04-arm
- os: ubuntu-22.04
image: docker.io/overte/overte-server-build:2026-02-09-ubuntu-22.04-amd64
arch: amd64
qt_source: system
runner: ubuntu-latest
- os: ubuntu-22.04
image: docker.io/overte/overte-server-build:2026-02-09-ubuntu-22.04-aarch64
arch: aarch64
qt_source: system
runner: ubuntu-24.04-arm
- os: ubuntu-24.04
image: docker.io/overte/overte-server-build:2026-02-09-ubuntu-24.04-amd64
arch: amd64
qt_source: system
runner: ubuntu-latest
- os: ubuntu-24.04
image: docker.io/overte/overte-server-build:2026-02-09-ubuntu-24.04-aarch64
arch: aarch64
qt_source: system
runner: ubuntu-24.04-arm
- os: fedora-42
image: docker.io/overte/overte-server-build:2026-02-09-fedora-42-amd64
arch: amd64
qt_source: system
runner: ubuntu-latest
- os: fedora-42
image: docker.io/overte/overte-server-build:2026-02-09-fedora-42-aarch64
arch: aarch64
qt_source: system
runner: ubuntu-24.04-arm
fail-fast: false
runs-on: ${{matrix.runner}}
container: ${{matrix.image}}
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: Read image environment variables
# Bring some environment variables out of the Runner (Docker) image's environment into the Job environment.
if: ${{matrix.image}}
shell: bash
run: |
echo "RPM_SHORTHAND=$RPM_SHORTHAND" >> $GITHUB_ENV
echo "CONAN_PROFILE=$CONAN_PROFILE" >> $GITHUB_ENV
- name: Configure Build Environment 1
shell: bash
run: |
# Get git commit
if [ "${{github.event_name}}" = "pull_request" ]; then
echo "GIT_COMMIT_SHORT=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV
else # master or tagged
echo "GIT_COMMIT_SHORT=`echo ${{ github.sha }} | cut -c1-7`" >> $GITHUB_ENV
fi
echo "REFNAME=${{ github.ref_name }}" >> $GITHUB_ENV
echo "JOB_NAME=${{matrix.os}}, ${{matrix.arch}}" >> $GITHUB_ENV
echo "CONAN_CPPSTD=gnu20" >> $GITHUB_ENV
if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then
echo "INSTALLER_EXT=deb" >> $GITHUB_ENV
else # RPM
if [ "${{ matrix.arch }}" == "amd64" ]; then
echo "INSTALLER_EXT=x86_64.rpm" >> $GITHUB_ENV
else
echo "INSTALLER_EXT=aarch64.rpm" >> $GITHUB_ENV
fi
fi
# Tagged builds. E.g. release or release candidate builds.
if [ "${{github.ref_type}}" == "tag" ]; then
echo "OVERTE_RELEASE_TYPE=PRODUCTION" >> $GITHUB_ENV
else
echo "OVERTE_RELEASE_TYPE=PR" >> $GITHUB_ENV
fi
echo "CMAKE_EXTRA=-DOVERTE_BUILD_SERVER=true -DOVERTE_BUILD_TOOLS=true -DOVERTE_BUILD_CLIENT=false" >> $GITHUB_ENV
# Configuration is broken into multiple steps because you can't set an env var and also reference it in the same step
- name: Configure Build Environment 2
shell: bash
run: |
# Versioning
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "DEBVERSION=${{ github.event.number }}PR-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV
echo "RPMVERSION=PR${{ github.event.number }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV
elif [ "${{ github.ref_name }}" = "master" ]; then
echo "DEBVERSION=${{ github.run_number }}master-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV
echo "RPMVERSION=master${{ github.run_number }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV
echo "UPLOAD_PREFIX=build/overte/master" >> $GITHUB_ENV
echo "RELEASE_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
else # tagged
echo "DEBVERSION=${{ github.ref_name }}-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV
# We remove all dash characters from RPM versions, because rpmbuild doesn't allow dashes in version numbers.
echo "RPMVERSION=${REFNAME//-}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV
fi
if [ "${{ github.ref_type }}" == "tag" ]; then # tagged
echo "RELEASE_NUMBER=${{ github.ref_name }}" >> $GITHUB_ENV
if [[ "${{ github.ref_name }}" == *"rc"* ]]; then # release candidate
# The uploader already creates a subfolder for each RELEASE_NUMBER.
echo "UPLOAD_PREFIX=build/overte/release-candidate/" >> $GITHUB_ENV
else # release
echo "UPLOAD_PREFIX=build/overte/release/" >> $GITHUB_ENV
fi
fi
- name: Configure Build Environment 3
shell: bash
run: |
if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then
if [ "${{ matrix.arch }}" == "aarch64" ]; then
echo "ARTIFACT_PATTERN=overte-server_${DEBVERSION}-1_arm64.$INSTALLER_EXT" >> $GITHUB_ENV
else # amd64
echo "ARTIFACT_PATTERN=overte-server_${DEBVERSION}-1_amd64.$INSTALLER_EXT" >> $GITHUB_ENV
fi
else # RPM
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.$RPM_SHORTHAND.$INSTALLER_EXT" >> $GITHUB_ENV
fi
- name: Install Conan dependencies
uses: ./.github/actions/conan-install
with:
qt_source: ${{matrix.qt_source}}
build_type: ${{env.BUILD_TYPE}}
cppstd: ${{env.CONAN_CPPSTD}}
conan_profile: ${{env.CONAN_PROFILE}}
- name: Upload dependency source backups
shell: bash
env:
# Token for uploading dependency source backups.
CONAN_BUILD_DEPENDENCIES_BACKUP_UPLOAD_TOKEN: ${{ secrets.CONAN_BUILD_DEPENDENCIES_BACKUP_UPLOAD_TOKEN }}
run: conan cache backup-upload || echo "Credentials cannot be accessed on remote Pull Request builds. Continuing…"
- name: Configure CMake
shell: bash
# This syntax requires CMake 3.23
run: cmake --preset conan-${BUILD_TYPE,,} -DOVERTE_RELEASE_TYPE=$OVERTE_RELEASE_TYPE -DOVERTE_RELEASE_NUMBER=$RELEASE_NUMBER -DOVERTE_GIT_COMMIT_SHORT=$GIT_COMMIT_SHORT $CMAKE_EXTRA
- name: Build Domain Server
shell: bash
run: cmake --build --target domain-server $CMAKE_BUILD_EXTRA
- name: Build Assignment Client
shell: bash
run: cmake --build --target assignment-client $CMAKE_BUILD_EXTRA
- name: Build Oven
shell: bash
run: cmake --build --target oven $CMAKE_BUILD_EXTRA
- name: Package
working-directory: pkg-scripts
shell: bash
run: |
if [[ "${{ matrix.os }}" = "ubuntu"* || "${{ matrix.os }}" = "debian"* ]]; then # Debian
./make-deb-server
else # RPM
./make-rpm-server
fi
- name: Upload artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_PATTERN }}
path: pkg-scripts/${{ env.ARTIFACT_PATTERN }}
- name: Upload artifact to S3
if: github.event_name != 'pull_request' # PR builds cannot be uploaded to S3
shell: bash
working-directory: pkg-scripts
env:
AWS_ACCESS_KEY_ID: ${{ secrets.s3_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.s3_secret_access_key }}
run: python3 $GITHUB_WORKSPACE/tools/ci-scripts/upload.py
- name: Output debug information
if: always()
uses: ./.github/actions/debug-info