forked from ganeshrvel/openmtp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
200 lines (160 loc) · 5.53 KB
/
codemagic.yaml
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
definitions:
instance_mac_mini_m1: &instance_mac_mini_m1
instance_type: mac_mini_m1
instance_mac_intel_x64: &instance_mac_intel_x64
instance_type: mac_pro
mac_m1_env_versions: &mac_m1_env_versions
node: 16.19.0
npm: 8.16.0
xcode: 15.3
mac_intel_x64_env_versions: &mac_intel_x64_env_versions
node: 16.19.0
npm: 8.16.0
xcode: 14.2
mac_m1_arm64_artifacts: &mac_m1_arm64_artifacts
artifacts:
- dist/mac_m1_arm64_artifacts.zip
env_mac_signing: &env_mac_signing
groups:
- mac_release
scripts:
- &create_sentry_cli_rc_file
name: Creating `~/.sentryclirc` file
script: |
sh -c "cat >> .sentryclirc << 'EOL'
[auth]
token=$SENTRY_TOKEN_ID
EOL"
- &create_sentry_properties_file
script: |
sh -c "cat >> sentry.properties << 'EOL'
[auth]
defaults.url=$SENTRY_URL
defaults.org=$SENTRY_ORG
defaults.project=$SENTRY_PROJECT
auth.token=$SENTRY_TOKEN_ID
EOL"
- &install_global_packages
name: Installing global packages
script: |
npm install -g yarn @sentry/cli node-gyp zx yarn --force
- &install_app_packages
name: Installing app packages
script: |
export NODE_OPTIONS=--max_old_space_size=8096
yarn
- &build_package
name: Building the Package
script: yarn package-mac
- &finalize_build_instance_mac_mini_m1
name: Build finished mac mini M1 successfully
script: |
cd dist
# remove the M1 arm64 artifacts zip file if it exists. This is to clean the files on the local machine. This command is redundant on the VM.
[ -e mac_m1_arm64_artifacts.zip ] && rm mac_m1_arm64_artifacts.zip
find . -name '*.dmg' -or -name '*.zip' -or -name 'latest-*.yml' -or -name 'latest-*.yaml' | zip mac_m1_arm64_artifacts.zip -@
touch ~/ARTIFACT_BUILD_SUCCESS
- &finalize_build_instance_mac_intel_x64
name: Build finished mac intel x64 successfully
script: |
cd dist
# remove the intel x64 artifacts zip file if it exists. This is to clean the files on the local machine. This command is redundant on the VM.
[ -e mac_intel_x64_artifacts.zip ] && rm mac_intel_x64_artifacts.zip
find . -name '*.dmg' -or -name '*.zip' -or -name 'latest-*.yml' -or -name 'latest-*.yaml' | zip mac_intel_x64_artifacts.zip -@
touch ~/ARTIFACT_BUILD_SUCCESS
- &start_mac_intel_x64_post_build_scripts_from_mac_m1
name: Starting intel x64 post build scripts from mac m1
script: |
if [ -e ~/ARTIFACT_BUILD_SUCCESS ]; then
./scripts/cicd/codemagic-start-mac-intel-x64-vm.mjs
else
echo "Build was unsuccessful. Skipping the launch of post build scripts";
exit 1;
fi
- &start_post_build_scripts_from_mac_intel_x64
name: Starting post build scripts from intel x64
script: |
if [ -e ~/ARTIFACT_BUILD_SUCCESS ]; then
./scripts/cicd/codemagic-publish-builds.mjs
else
echo "Build was unsuccessful. Skipping the launch of post build scripts";
exit 1;
fi
email_recipients: &email_recipients
email:
recipients:
- $PUBLISH_EMAIL
scripts_instance_mac_mini_m1: &scripts_instance_mac_mini_m1
scripts:
- *create_sentry_cli_rc_file
- *create_sentry_properties_file
- *install_global_packages
- *install_app_packages
- *build_package
- *finalize_build_instance_mac_mini_m1
scripts_instance_mac_intel_x64: &scripts_instance_mac_intel_x64
scripts:
- *create_sentry_cli_rc_file
- *create_sentry_properties_file
- *install_global_packages
- *install_app_packages
- *build_package
- *finalize_build_instance_mac_intel_x64
workflows:
# prod - macOS M1 arm64 build
macos-m1-arm64-build-prod:
name: (1st script, Run this) Prod - macOS M1 arm64 build
<<: *instance_mac_mini_m1
environment:
<<: *env_mac_signing
<<: *mac_m1_env_versions
vars:
WORKFLOW_ENV: 'prod'
<<: *scripts_instance_mac_mini_m1
<<: *mac_m1_arm64_artifacts
publishing:
scripts:
- *start_mac_intel_x64_post_build_scripts_from_mac_m1
# prod - macOS Intel x64 build
macos-intel-x64-build-prod:
name: (Do not run this directly) Prod - macOS Intel x64 build
<<: *instance_mac_intel_x64
environment:
<<: *env_mac_signing
<<: *mac_intel_x64_env_versions
vars:
WORKFLOW_ENV: 'prod'
<<: *scripts_instance_mac_intel_x64
publishing:
<<: *email_recipients
scripts:
- *start_post_build_scripts_from_mac_intel_x64
###################
# dev - macOS M1 arm64 build
macos-m1-arm64-build-dev:
name: (1st script, Run this) Dev - macOS M1 arm64 build
<<: *instance_mac_mini_m1
environment:
<<: *env_mac_signing
<<: *mac_m1_env_versions
vars:
WORKFLOW_ENV: 'dev'
<<: *scripts_instance_mac_mini_m1
<<: *mac_m1_arm64_artifacts
publishing:
scripts:
- *start_mac_intel_x64_post_build_scripts_from_mac_m1
# dev - macOS Intel x64 build
macos-intel-x64-build-dev:
name: (Do not run this directly) Dev - macOS Intel x64 build
<<: *instance_mac_intel_x64
environment:
<<: *env_mac_signing
<<: *mac_intel_x64_env_versions
vars:
WORKFLOW_ENV: 'dev'
<<: *scripts_instance_mac_intel_x64
publishing:
<<: *email_recipients
scripts:
- *start_post_build_scripts_from_mac_intel_x64