-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
55 lines (45 loc) · 1.51 KB
/
justfile
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
set dotenv-load
replace-package:
rm -rf ~/Documents/Max\ 8/Packages/petunia
cp -r {{justfile_directory()}}/petunia ~/Documents/Max\ 8/Packages/petunia
install:
cargo make --profile release install
package-all:
cargo make --profile release package-all
# Environment variables needed for notarization
APPLE_ID := env_var('APPLE_ID')
APP_PASSWORD := env_var('APP_PASSWORD')
TEAM_ID := env_var('TEAM_ID')
notarize:
#!/usr/bin/env bash
cleanup() {
local dir="{{justfile_directory()}}/petunia/externals"
echo "🧹 Cleaning up artifacts..."
rm -f "${dir}/rytm.zip"
rm -f "${dir}/rytm_notarization.log"
}
# Register cleanup function to run on script exit
trap cleanup EXIT
set -euo pipefail
cd {{justfile_directory()}}/petunia/externals
rm -f rytm.zip
zip -r rytm.zip rytm.mxo
rm -f rytm_notarization.log
xcrun notarytool submit rytm.zip \
--apple-id "{{APPLE_ID}}" \
--password "{{APP_PASSWORD}}" \
--team-id "{{TEAM_ID}}" \
--wait \
--output-format json \
> rytm_notarization.log
STATUS=$(cat rytm_notarization.log | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
if [ "$STATUS" = "Accepted" ]; then
echo "✅ Notarization succeeded"
else
echo "❌ Notarization failed with status: $STATUS"
cat rytm_notarization.log
exit 1
fi
cd {{justfile_directory()}}
xcrun stapler staple petunia/externals/rytm.mxo
xcrun stapler validate petunia/externals/rytm.mxo