forked from musescore/MuseScore
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (115 loc) · 4.37 KB
/
ci_macos_mu3.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
name: CI_MacOS MU3
on:
# At the moment, the mu3 is not automatically building
# pull_request:
# branches:
# - master
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'
env:
DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer
jobs:
build_mu3:
runs-on: macos-10.15
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Clone repository (default)
if: ${{ github.event_name != 'schedule' }}
uses: actions/checkout@v3
- name: Clone repository (3.x for build nightly )
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@v3
with:
ref: 3.x
- name: "Configure workflow"
run: |
bash ./build/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)
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_NOTARIZE='false'
if [ "$BUILD_MODE" != "devel_build" ]; then
DO_NOTARIZE='true'
if [ -z "${{ secrets.APPLE_USERNAME }}" ]; then
echo "warning: not set APPLE_USERNAME, notarize disabled"
DO_NOTARIZE='false'
fi
if [ -z "${{ secrets.APPLE_PASSWORD }}" ]; then
echo "warning: not set APPLE_PASSWORD, notarize disabled"
DO_NOTARIZE='false'
fi
fi
DO_BUILD='true'
if [ "$BUILD_MODE" == "nightly_build" ]; then
if [ "${{ github.repository }}" != "musescore/MuseScore" ]; then
DO_BUILD='false'
DO_NOTARIZE='false'
DO_PUBLISH='false'
fi
fi
echo "github.repository: ${{ github.repository }}"
echo "BUILD_MODE=$BUILD_MODE" >> $GITHUB_ENV
echo "BUILD_MODE: $BUILD_MODE"
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "DO_NOTARIZE=$DO_NOTARIZE" >> $GITHUB_ENV
echo "DO_NOTARIZE: $DO_NOTARIZE"
echo "DO_PUBLISH=$DO_PUBLISH" >> $GITHUB_ENV
echo "DO_PUBLISH: $DO_PUBLISH"
- name: Setup environment
if: env.DO_BUILD == 'true'
run: |
bash ./build/ci/macos/setup.sh
- name: Build
if: env.DO_BUILD == 'true'
run: |
T_ID=${{ secrets.TELEMETRY_TRACK_ID }}; if [ -z "$T_ID" ]; then T_ID="''"; fi
bash ./build/ci/macos/build.sh -n ${{ github.run_id }} --telemetry $T_ID
- name: Package
if: env.DO_BUILD == 'true'
run: |
S_S="${{ secrets.MAC_SIGN_CERTIFICATE_ENCRYPT_SECRET }}"; if [ -z "$S_S" ]; then S_S="''"; fi
S_P="${{ secrets.MAC_SIGN_CERTIFICATE_PASSWORD }}"; if [ -z "$S_P" ]; then S_P="''"; fi
bash ./build/ci/macos/package.sh --signpass "$S_P" --signsecret "$S_S"
- name: Notarize
if: env.DO_NOTARIZE == 'true'
run: |
USER=${{ secrets.APPLE_USERNAME }}; if [ -z "$USER" ]; then USER="''"; fi
PW=${{ secrets.APPLE_PASSWORD }}; if [ -z "$PW" ]; then PW="''"; fi
bash ./build/ci/macos/notarize.sh -u $USER -p $PW
- name: Checksum
if: env.DO_BUILD == 'true'
run: |
bash ./build/ci/tools/checksum.sh
- name: Publish package
if: env.DO_PUBLISH == 'true'
run: |
if [ "$BUILD_MODE" == "nightly_build" ]; then VER=3; else VER=4; fi
sudo bash ./build/ci/tools/osuosl/publish.sh -s ${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }} --os macos -v $VER
- name: AppCast
if: env.DO_BUILD == 'true'
run: |
bash ./build/ci/tools/sparkle_appcast_gen.sh -p macos
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v3
with:
name: MuseScore_${{ github.run_id }}
path: ./build.artifacts/