forked from musescore/MuseScore
-
Notifications
You must be signed in to change notification settings - Fork 0
273 lines (247 loc) · 11.9 KB
/
ci_linux_arm_mu4.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
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: CI_Linux_ARM MU4
on:
schedule:
- cron: '0 3 */1 */1 *' # At 03:00 on every day-of-month for master
# - cron: '0 3 */1 */1 *' # At 05:00 on every day-of-month for current release branch
workflow_dispatch:
inputs:
build_mode:
description: 'Build mode: devel_build, nightly_build, testing_build, stable_build'
required: true
default: 'devel_build'
publish:
description: 'Publish to FTP: on - publish'
required: false
default: 'off'
sentry_project:
description: 'Upload symbols and dumps to Sentry (choose a project): mu4(default for stable build), sandbox'
required: false
default: ''
#env:
# CURRENT_RELEASE_BRANCH: 4.3.0
jobs:
build_armhf:
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Clone repository (default)
uses: actions/checkout@v4
if: ${{ github.event_name != 'schedule' || github.event.schedule == '0 3 */1 */1 *' }}
- name: Clone repository (${{ env.CURRENT_RELEASE_BRANCH }})
uses: actions/checkout@v4
if: ${{ github.event_name == 'schedule' && github.event.schedule == '0 5 */1 */1 *' }}
with:
ref: ${{ env.CURRENT_RELEASE_BRANCH }}
- name: setup QEMU
run: |
sudo apt update
sudo apt install qemu-user-static -y
- name: "Configure workflow"
env:
pull_request_title: ${{ github.event.pull_request.title }}
SENTRY_SERVER_MU4_KEY: ${{ secrets.SENTRY_SERVER_MU4_KEY }}
SENTRY_SERVER_SANDBOX_KEY: ${{ secrets.SENTRY_SERVER_SANDBOX_KEY }}
SENTRY_PROJECT: ${{ github.event.inputs.sentry_project }}
run: |
sudo bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ github.event.inputs.build_mode }}
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
sudo bash ./buildscripts/ci/tools/make_build_number.sh
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
DO_PUBLISH='false'
if [[ "${{ github.event.inputs.publish }}" == "on" || "$BUILD_MODE" == "nightly_build" ]]; then
DO_PUBLISH='true'
if [ -z "${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }}" ]; then
echo "warning: not set OSUOSL_SSH_ENCRYPT_SECRET, publish disabled"
DO_PUBLISH='false'
fi
fi
DO_BUILD='true'
if [ "$BUILD_MODE" == "nightly_build" ]; then
if [ "${{ github.repository }}" != "musescore/MuseScore" ]; then
DO_BUILD='false'
fi
fi
DO_PLACEHOLDER_TRANSLATIONS='false'
if [[ "$DO_BUILD" == "true" ]]; then
if [[ "$BUILD_MODE" == "nightly_build" || "$BUILD_MODE" == "devel_build" ]]; then
DO_PLACEHOLDER_TRANSLATIONS='true'
fi
fi
DO_UPLOAD_SYMBOLS='false'
SENTRY_URL=""
if [ "$SENTRY_SERVER_MU4_KEY" != "" ]; then
if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "stable_build" ]; then
SENTRY_PROJECT="mu4"
fi
if [ "$SENTRY_PROJECT" == "mu4" ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.musescore.org/api/4/minidump/?sentry_key=$SENTRY_SERVER_MU4_KEY
fi
fi
if [ "$SENTRY_PROJECT" == "sandbox" ] && [ "$SENTRY_SERVER_SANDBOX_KEY" != "" ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.musescore.org/api/3/minidump/?sentry_key=$SENTRY_SERVER_SANDBOX_KEY
fi
if [ $DO_BUILD == 'false' ]; then
DO_UPLOAD_SYMBOLS='false'
DO_PUBLISH='false'
fi
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.event.schedule }}" == "0 5 */1 */1 *" ]; then ADD_INFO="_${CURRENT_RELEASE_BRANCH}"; fi
if [ "${{ github.event_name }}" == "pull_request" ]; then ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"; fi
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Lin_armv7l${ADD_INFO}")"
echo "github.repository: ${{ github.repository }}"
echo "BUILD_MODE=$BUILD_MODE" >> $GITHUB_ENV
echo "BUILD_MODE: $BUILD_MODE"
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
echo "BUILD_NUMBER: $BUILD_NUMBER"
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "DO_PLACEHOLDER_TRANSLATIONS=$DO_PLACEHOLDER_TRANSLATIONS" >> $GITHUB_ENV
echo "DO_PLACEHOLDER_TRANSLATIONS: $DO_PLACEHOLDER_TRANSLATIONS"
echo "DO_PUBLISH=$DO_PUBLISH" >> $GITHUB_ENV
echo "DO_PUBLISH: $DO_PUBLISH"
echo "DO_UPLOAD_SYMBOLS=$DO_UPLOAD_SYMBOLS" >> $GITHUB_ENV
echo "DO_UPLOAD_SYMBOLS: $DO_UPLOAD_SYMBOLS"
echo "SENTRY_PROJECT=$SENTRY_PROJECT" >> $GITHUB_ENV
echo "SENTRY_PROJECT: $SENTRY_PROJECT"
echo "SENTRY_URL=$SENTRY_URL" >> $GITHUB_ENV
echo "SENTRY_URL: $SENTRY_URL"
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" >> $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME: $UPLOAD_ARTIFACT_NAME"
- name: Setup, Generate, Update, Build the AppImage
if: env.DO_BUILD == 'true'
run: |
C_URL=${SENTRY_URL}; if [ -z "$C_URL" ]; then C_URL="''"; fi
sudo docker run -i -v "${PWD}:/MuseScore" -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static "arm32v7/ubuntu:focal" /bin/bash -c "cd /MuseScore && \
bash /MuseScore/buildscripts/ci/linux/setup-arm.sh --arch armv7l && \
bash /MuseScore/buildscripts/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --crash_log_url $C_URL --arch armv7l && \
bash ./buildscripts/ci/linux/dumpsyms.sh && \
bash /MuseScore/buildscripts/ci/linux/package.sh --arch armv7l && \
bash /MuseScore/buildscripts/ci/tools/checksum.sh"
- name: Upload dump symbols
if: env.DO_UPLOAD_SYMBOLS == 'true'
run: |
sudo bash ./buildscripts/ci/tools/sentry_syms_upload.sh -t ${{ secrets.SENTRY_AUTH_TOKEN }} -p ${SENTRY_PROJECT}
- name: Publish package
if: env.DO_PUBLISH == 'true'
run: |
sudo bash ./buildscripts/ci/tools/osuosl/publish.sh -s ${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }} --os linux --arch armv7l -v 4
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts/
build_arm64:
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Clone repository (default)
uses: actions/checkout@v4
if: ${{ github.event_name != 'schedule' || github.event.schedule == '0 3 */1 */1 *' }}
- name: Clone repository (${{ env.CURRENT_RELEASE_BRANCH }})
uses: actions/checkout@v4
if: ${{ github.event_name == 'schedule' && github.event.schedule == '0 5 */1 */1 *' }}
with:
ref: ${{ env.CURRENT_RELEASE_BRANCH }}
- name: setup QEMU
run: |
sudo apt update
sudo apt install qemu-user-static -y
- name: "Configure workflow"
env:
pull_request_title: ${{ github.event.pull_request.title }}
run: |
sudo bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ github.event.inputs.build_mode }}
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
sudo bash ./buildscripts/ci/tools/make_build_number.sh
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
DO_PUBLISH='false'
if [[ "${{ github.event.inputs.publish }}" == "on" || "$BUILD_MODE" == "nightly_build" ]]; then
DO_PUBLISH='true'
if [ -z "${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }}" ]; then
echo "warning: not set OSUOSL_SSH_ENCRYPT_SECRET, publish disabled"
DO_PUBLISH='false'
fi
fi
DO_BUILD='true'
if [ "$BUILD_MODE" == "nightly_build" ]; then
if [ "${{ github.repository }}" != "musescore/MuseScore" ]; then
DO_BUILD='false'
fi
fi
DO_PLACEHOLDER_TRANSLATIONS='false'
if [[ "$DO_BUILD" == "true" ]]; then
if [[ "$BUILD_MODE" == "nightly_build" || "$BUILD_MODE" == "devel_build" ]]; then
DO_PLACEHOLDER_TRANSLATIONS='true'
fi
fi
DO_UPLOAD_SYMBOLS='false'
SENTRY_PROJECT=${{ github.event.inputs.sentry_project }}
SENTRY_URL=""
if [ "$SENTRY_PROJECT" == "editor" ] && [ ${{ secrets.SENTRY_SERVER_MU3_KEY }} != 0 ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.musescore.org/api/2/minidump/?sentry_key=${{ secrets.SENTRY_SERVER_MU3_KEY }}
fi
if [ "$SENTRY_PROJECT" == "sandbox" ] && [ ${{ secrets.SENTRY_SERVER_SANDBOX_KEY }} != 0 ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.musescore.org/api/3/minidump/?sentry_key=${{ secrets.SENTRY_SERVER_SANDBOX_KEY }}
fi
if [ $DO_BUILD == 'false' ]; then
DO_UPLOAD_SYMBOLS='false'
DO_PUBLISH='false'
fi
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.event.schedule }}" == "0 5 */1 */1 *" ]; then ADD_INFO="_${CURRENT_RELEASE_BRANCH}"; fi
if [ "${{ github.event_name }}" == "pull_request" ]; then ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"; fi
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Lin_aarch64${ADD_INFO}")"
echo "github.repository: ${{ github.repository }}"
echo "BUILD_MODE=$BUILD_MODE" >> $GITHUB_ENV
echo "BUILD_MODE: $BUILD_MODE"
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
echo "BUILD_NUMBER: $BUILD_NUMBER"
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "DO_PLACEHOLDER_TRANSLATIONS=$DO_PLACEHOLDER_TRANSLATIONS" >> $GITHUB_ENV
echo "DO_PLACEHOLDER_TRANSLATIONS: $DO_PLACEHOLDER_TRANSLATIONS"
echo "DO_PUBLISH=$DO_PUBLISH" >> $GITHUB_ENV
echo "DO_PUBLISH: $DO_PUBLISH"
echo "DO_UPLOAD_SYMBOLS=$DO_UPLOAD_SYMBOLS" >> $GITHUB_ENV
echo "DO_UPLOAD_SYMBOLS: $DO_UPLOAD_SYMBOLS"
echo "SENTRY_PROJECT=$SENTRY_PROJECT" >> $GITHUB_ENV
echo "SENTRY_PROJECT: $SENTRY_PROJECT"
echo "SENTRY_URL=$SENTRY_URL" >> $GITHUB_ENV
echo "SENTRY_URL: $SENTRY_URL"
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" >> $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME: $UPLOAD_ARTIFACT_NAME"
- name: Setup, Generate, Update, Build the AppImage
if: env.DO_BUILD == 'true'
run: |
C_URL=${SENTRY_URL}; if [ -z "$C_URL" ]; then C_URL="''"; fi
sudo docker run -i -v "${PWD}:/MuseScore" -v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static "arm64v8/ubuntu:focal" /bin/bash -c "cd /MuseScore && \
bash /MuseScore/buildscripts/ci/linux/setup-arm.sh --arch aarch64 && \
bash /MuseScore/buildscripts/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --crash_log_url $C_URL --arch aarch64 && \
bash ./buildscripts/ci/linux/dumpsyms.sh && \
bash /MuseScore/buildscripts/ci/linux/package.sh --arch aarch64 && \
bash /MuseScore/buildscripts/ci/tools/checksum.sh"
- name: Upload dump symbols
if: env.DO_UPLOAD_SYMBOLS == 'true'
run: |
sudo bash ./buildscripts/ci/tools/sentry_syms_upload.sh -t ${{ secrets.SENTRY_AUTH_TOKEN }} -p ${SENTRY_PROJECT}
- name: Publish package
if: env.DO_PUBLISH == 'true'
run: |
sudo bash ./buildscripts/ci/tools/osuosl/publish.sh -s ${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }} --os linux --arch aarch64 -v 4
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts/