-
Notifications
You must be signed in to change notification settings - Fork 2.7k
155 lines (137 loc) · 5.03 KB
/
build_all.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
name: 'Build: All'
on:
workflow_dispatch:
inputs:
platforms:
description: 'Platforms to build:'
default: 'backend linux_arm32 linux_arm64 linux_x64 macos windows_x64 windows_portable'
required: true
build_mode:
description: 'Build mode: devel,nightly,testing,stable'
default: 'devel'
required: true
publish:
description: 'Publish to FTP: on - publish'
default: 'off'
required: false
sentry_project:
description: 'Upload symbols and dumps to Sentry (choose a project): mu4(default for stable build), sandbox'
default: ''
required: false
workflow_call:
inputs:
platforms:
description: 'Platforms to build:'
default: 'backend linux_arm32 linux_arm64 linux_x64 macos windows_x64 windows_portable'
type: string
required: true
build_mode:
description: 'Build mode: devel,nightly,testing,stable'
default: 'devel'
type: string
required: true
publish:
description: 'Publish to FTP: on - publish'
default: 'off'
type: string
required: false
sentry_project:
description: 'Upload symbols and dumps to Sentry (choose a project): mu4(default for stable build), sandbox'
default: ''
type: string
required: false
defaults:
run:
shell: bash
jobs:
backend:
name: Backend
if: ${{ contains(inputs.platforms, 'backend') }}
uses: ./.github/workflows/build_backend.yml
secrets: inherit
with:
build_mode: ${{ inputs.build_mode }}
publish: ${{ inputs.publish }}
linux_arm:
name: Linux ARM
uses: ./.github/workflows/build_linux_arm.yml
secrets: inherit
with:
platforms: ${{ inputs.platforms }}
build_mode: ${{ inputs.build_mode }}
publish: ${{ inputs.publish }}
sentry_project: ${{ inputs.sentry_project }}
linux_x64:
name: Linux x64
if: ${{ contains(inputs.platforms, 'linux_x64') }}
uses: ./.github/workflows/build_linux.yml
secrets: inherit
with:
build_mode: ${{ inputs.build_mode }}
publish: ${{ inputs.publish }}
sentry_project: ${{ inputs.sentry_project }}
macos:
name: macOS
if: ${{ contains(inputs.platforms, 'macos') }}
uses: ./.github/workflows/build_macos.yml
secrets: inherit
with:
build_mode: ${{ inputs.build_mode }}
publish: ${{ inputs.publish }}
sentry_project: ${{ inputs.sentry_project }}
windows:
name: Windows
uses: ./.github/workflows/build_windows.yml
secrets: inherit
with:
platforms: ${{ inputs.platforms }}
build_mode: ${{ inputs.build_mode }}
publish: ${{ inputs.publish }}
sentry_project: ${{ inputs.sentry_project }}
# Dummy build for testing purposes.
dummy:
if: ${{ contains(inputs.platforms, 'dummy') }}
strategy:
fail-fast: false
matrix:
# Expose edge cases like different command versions, CRLF line endings, etc.
# Use same OS versions as used in real build workflows.
os:
- ubuntu-20.04 # linux_x64, backend
- ubuntu-22.04 # linux_arm32, linux_arm64
- macos-latest
- windows-2022 # windows_x64, windows_portable
runs-on: ${{ matrix.os }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Prepare dummy artifact
run: |
ARTIFACTS_DIR="build.artifacts"
echo "ARTIFACTS_DIR=${ARTIFACTS_DIR}" | tee -a "${GITHUB_ENV}"
buildscripts/ci/tools/make_build_mode_env.sh -e "${{ github.event_name }}" -m "${{ inputs.build_mode }}"
BUILD_MODE="$(<"${ARTIFACTS_DIR}/env/build_mode.env")"
case "${BUILD_MODE}" in
testing) MUSE_APP_BUILD_MODE=testing;;
stable) MUSE_APP_BUILD_MODE=release;;
*) MUSE_APP_BUILD_MODE=dev;;
esac
buildscripts/ci/tools/make_build_number.sh
BUILD_NUMBER="$(<"${ARTIFACTS_DIR}/env/build_number.env")"
buildscripts/ci/tools/make_version_env.sh "${BUILD_NUMBER}"
BUILD_VERSION="$(<"${ARTIFACTS_DIR}/env/build_version.env")"
buildscripts/ci/tools/make_branch_env.sh
BUILD_BRANCH="$(<"${ARTIFACTS_DIR}/env/build_branch.env")"
buildscripts/ci/tools/make_release_channel_env.sh -c "${MUSE_APP_BUILD_MODE}"
buildscripts/ci/tools/make_revision_env.sh "$(git rev-parse --short=7 HEAD)"
buildscripts/ci/tools/make_artifact_name_env.sh "MuseScore-Dummy-${BUILD_VERSION}-${{ matrix.os }}-${HOSTTYPE}.txt"
ARTIFACT_NAME="$(<"${ARTIFACTS_DIR}/env/artifact_name.env")"
echo "Hello, world!" >"${ARTIFACTS_DIR}/${ARTIFACT_NAME}"
buildscripts/ci/tools/checksum.sh
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Dummy-${{ matrix.os }}_${BUILD_BRANCH}")"
echo "UPLOAD_ARTIFACT_NAME=${UPLOAD_ARTIFACT_NAME}" | tee -a "${GITHUB_ENV}"
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ${{ env.ARTIFACTS_DIR }}