-
-
Notifications
You must be signed in to change notification settings - Fork 51
187 lines (159 loc) · 6.21 KB
/
linux_appimage_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
178
179
180
181
182
183
184
185
# Copyright 2013-2019 High Fidelity, Inc.
# Copyright 2020-2022 Vircadia contributors.
# Copyright 2021-2024 Overte e.V.
# SPDX-License-Identifier: Apache-2.0
name: Linux AppImage build
on:
pull_request:
types: [opened, synchronize, reopened]
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].**"
defaults:
run:
shell: bash
env:
BUILD_TYPE: Release
UPLOAD_BUCKET: overte-public
UPLOAD_REGION: fra1
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
# Disable VCPKG caching to save time.
VCPKG_FEATURE_FLAGS: -binarycaching
jobs:
build:
name: "${{matrix.os}}, ${{matrix.arch}}"
strategy:
matrix:
include:
- os: ubuntu-20.04
arch: amd64
# https://github.com/testflows/TestFlows-GitHub-Hetzner-Runners/wiki/Meta-Labels
# self_hosted makes the Hetzner auto-scaler put up the job.
# type-cx52 is a Hetzner VPS server type. In this case cs52 is a server with 16-cores and 32GB of RAM.
# image-x86-app-docker-ce is a Hetzner image.
# https://github.com/testflows/TestFlows-GitHub-Hetzner-Runners/wiki/Specifying-The-Runner-Image
runner: [self_hosted, type-cx52, image-x86-system-ubuntu-20.04]
fail-fast: true
runs-on: ${{matrix.runner}}
steps:
- name: Clear Working Directories
shell: bash
run: |
rm -rf ./*
rm -rf ~/overte-files
rm -rf ~/.cache
- name: Prepare Working Directories
shell: bash
run: |
mkdir -p appimage
cd appimage
if [ -d "overte-builder" ] ; then
rm -rf "overte-builder"
fi
- name: Download Overte Builder
shell: bash
working-directory: appimage
run: |
git clone --depth=1 https://github.com/overte-org/overte-builder.git
- name: Install dependencies
shell: bash
working-directory: appimage
run: |
basedir=`pwd`
overtedir="$basedir/Overte"
cd overte-builder
./overte-builder --auto --make-appimage --skip-build --skip-install --install-deps-only --destdir="$overtedir"
- name: Build AppImage
shell: bash
working-directory: appimage
run: |
basedir=`pwd`
overtedir="$basedir/Overte"
if [ -d "$overtedir" ] ; then
# Get rid of any existing AppImage
echo Cleaning up previous AppImages
rm -v $overtedir/*AppImage || true
fi
if [ "${{ github.ref_type }}" == "tag" ]; then
export CMAKE_BACKTRACE_URL="${{ secrets.SENTRY_MINIDUMP_ENDPOINT }}"
export CMAKE_BACKTRACE_TOKEN="${{ github.ref_name }}_${{ matrix.os }}_${{ github.sha }}"
else
# We're building a PR, default to the PR endpoint
export CMAKE_BACKTRACE_URL="https://o4504831972343808.ingest.sentry.io/api/4504832427950080/minidump/?sentry_key=f511de295975461b8f92a36f4a4a4f32"
export CMAKE_BACKTRACE_TOKEN="server_pr_${{ github.event.number }}_${{ github.sha }}"
fi
cd overte-builder
./overte-builder --auto --make-appimage --destdir="$overtedir"
# Warning: We generate an appimage/Overte/Overte.AppImage directory which is then
# used to generate the actual AppImage. We don't want to upload that as an artifact,
# as that's what's inside the AppImage files anyway.
#
# We tailor the path pattern to exclude it, but we'll also remove it for good measure.
- name: Remove unneeded AppImage directory
shell: bash
working-directory: appimage
run: |
if [ -d "Overte/Overte.AppImage" ] ; then
rm -rf "Overte/Overte.AppImage"
fi
- name: Upload AppImage without debug info to GitHub
if: contains( github.event.pull_request.labels.*.name, 'upload_to_github')
uses: actions/upload-artifact@v3
with:
name: Overte-nodebug-x86_64.AppImage
path: appimage/Overte/Overte-*-nodebug-x86_64.AppImage
- name: Upload AppImage with debug info to GitHub
if: contains( github.event.pull_request.labels.*.name, 'upload_to_github')
uses: actions/upload-artifact@v3
with:
name: Overte-debug-x86_64.AppImage
path: appimage/Overte/Overte-*-debug-x86_64.AppImage
# - name: Upload AppImage without debugging to S3
# if: contains( github.event.pull_request.labels.*.name, 'upload_to_github') == false
# shell: bash
# working-directory: appimage
# run: |
# if [ ! -x "/usr/local/bin/upload_to_s3" ] ; then
# echo "Couldn't find /usr/local/bin/upload_to_s3 upload script. Label this with upload_to_github to upload to GitHub instead."
# exit 1
# fi
#
# filename=`find Overte -maxdepth 1 -name 'Overte-*-nodebug-x86_64.AppImage'`
# base=`basename "$filename"`
#
# sudo -u uploader /usr/local/bin/upload_to_s3 --type "${{ github.event_name }}" --number ${{ github.event.number }} --name "$base" < "$filename"
#
# - name: Upload AppImage with debugging to S3
# if: contains( github.event.pull_request.labels.*.name, 'upload_to_github') == false
# shell: bash
# working-directory: appimage
# run: |
# if [ ! -x "/usr/local/bin/upload_to_s3" ] ; then
# echo "Couldn't find /usr/local/bin/upload_to_s3 upload script. Label this with upload_to_github to upload to GitHub instead."
# exit 1
# fi
#
# filename=`find Overte -maxdepth 1 -name 'Overte-*-debug-x86_64.AppImage'`
# base=`basename "$filename"`
#
# sudo -u uploader /usr/local/bin/upload_to_s3 --type "${{ github.event_name }}" --number ${{ github.event.number }} --name "$base" < "$filename"
- name: Cleanup
if: ${{ always() }}
shell: bash
working-directory: appimage
run: |
rm -rf Overte/*AppImage Overte/build
- name: Clear Working Directories
shell: bash
run: |
rm -rf ./*
rm -rf ~/overte-files
rm -rf ~/.cache
- name: Output system stats
if: ${{ always() }}
shell: bash
run: |
echo "Disk usage:"
df -h