forked from audacity/audacity
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (108 loc) · 4.55 KB
/
ci_macos_au4.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
name: CI_MacOS
on:
pull_request:
paths: ["au4/**"]
branches:
- master
schedule:
- cron: '0 3 */1 */1 *' # At 03:00 on every day-of-month for master
# - cron: '0 5 */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'
sentry_project:
description: 'Upload symbols and dumps to Sentry (choose a project): audacity-4(default for stable build), audacity-4-sandbox'
required: false
default: ''
env:
CI_DIR: au4/buildscripts/ci
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
jobs:
build_au4:
runs-on: macos-13
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: "Configure workflow"
env:
pull_request_title: ${{ github.event.pull_request.title }}
SENTRY_SERVER_AU4_KEY: ${{ secrets.SENTRY_SERVER_AU4_KEY }}
SENTRY_SERVER_SANDBOX_KEY: ${{ secrets.SENTRY_SERVER_SANDBOX_KEY }}
SENTRY_PROJECT: ${{ github.event.inputs.sentry_project }}
run: |
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.event.schedule }}" == "0 5 */1 */1 *" ]; then ADD_INFO="_${{ env.CURRENT_RELEASE_BRANCH }}"; fi
if [ "${{ github.event_name }}" == "pull_request" ]; then ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"; fi
BUILD_MODE=${{ github.event.inputs.build_mode }}
cmake -DEVENT=${{ github.event_name }} \
-DBUILD_MODE=${BUILD_MODE} \
-DARTIFACT_INFO="Mac_${ADD_INFO}" \
-P ${CI_DIR}/common/ci_configure.cmake
DO_BUILD='true'
UPLOAD_ARTIFACT_NAME=$(cat ./build.artifacts/env/artifact_name.env)
DO_UPLOAD_SYMBOLS='false'
SENTRY_URL=""
if [ "$SENTRY_SERVER_AU4_KEY" != "" ]; then
if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "stable_build" ]; then
SENTRY_PROJECT="audacity-4"
fi
if [ "$SENTRY_PROJECT" == "audacity-4" ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.audacityteam.org/api/5/minidump/?sentry_key=$SENTRY_SERVER_AU4_KEY
fi
fi
if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "nightly_build" ]; then
SENTRY_PROJECT="audacity-4-sandbox"
fi
if [ "$SENTRY_PROJECT" == "audacity-4-sandbox" ] && [ "$SENTRY_SERVER_SANDBOX_KEY" != "" ]; then
DO_UPLOAD_SYMBOLS='true'
SENTRY_URL=https://sentry.audacityteam.org/api/5/minidump/?sentry_key=$SENTRY_SERVER_SANDBOX_KEY
fi
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" >> $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME: $UPLOAD_ARTIFACT_NAME"
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"
- name: Setup environment
if: env.DO_BUILD == 'true'
run: |
bash ${CI_DIR}/macos/setup.sh
- name: Build
if: env.DO_BUILD == 'true'
run: |
source $HOME/build_tools/environment.sh
cmake -P ${CI_DIR}/macos/ci_build.cmake
- name: Package
if: env.DO_BUILD == 'true'
run: |
source $HOME/build_tools/environment.sh
cmake -P ${CI_DIR}/macos/package.cmake
- name: Generate and upload dump symbols
if: env.DO_UPLOAD_SYMBOLS == 'true'
shell: bash
run: |
APP_BIN=$(pwd)/applebuild/audacity.app/Contents/MacOS/audacity
GENERATE_ARCHS=("x86_64 arm64")
BUILD_DIR=$(pwd)/applebuild
cmake -DAPP_BIN=${APP_BIN} \
-DGENERATE_ARCHS="${GENERATE_ARCHS}" \
-DBUILD_DIR=${BUILD_DIR} \
-DSENTRY_URL=https://sentry.audacityteam.org \
-DSENTRY_ORG=sentry \
-DSENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \
-DSENTRY_PROJECT=${SENTRY_PROJECT} \
-P ${CI_DIR}/crashdumps/ci_generate_and_upload.cmake
- name: Upload artifacts on GitHub
if: env.DO_BUILD == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts