-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·91 lines (77 loc) · 2.08 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·91 lines (77 loc) · 2.08 KB
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
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage:
./release.sh --version VERSION --team-id TEAM_ID
./release.sh VERSION TEAM_ID
Runs the release build steps starting at `make clean`.
EOF
}
VERSION=""
TEAMID=""
while [[ $# -gt 0 ]]; do
case "$1" in
-v|--version)
VERSION="${2:-}"
shift 2
;;
-t|--team-id)
TEAMID="${2:-}"
shift 2
;;
-h|--help)
usage
exit 0
;;
-*)
echo "Unknown option: $1" >&2
usage >&2
exit 1
;;
*)
if [[ -z "$VERSION" ]]; then
VERSION="$1"
elif [[ -z "$TEAMID" ]]; then
TEAMID="$1"
else
echo "Unexpected argument: $1" >&2
usage >&2
exit 1
fi
shift
;;
esac
done
if [[ -z "$VERSION" || -z "$TEAMID" ]]; then
usage >&2
exit 1
fi
echo "Cleaning build artifacts"
make clean
echo "Creating signed zip"
make zip
echo "Creating Homebrew bottle for $VERSION"
make bottle VERSION="$VERSION"
echo "Duplicating bottle for expected platform filenames"
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.arm64_mojave.bottle.tar.gz"
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.macos.i386.bottle.tar.gz"
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.macos.arm64.bottle.tar.gz"
echo "Notarizing release build with team ID $TEAMID"
make notarize TEAMID="$TEAMID"
cat <<EOF
Release assets are ready:
xcodes.zip
xcodes-$VERSION.mojave.bottle.tar.gz
xcodes-$VERSION.arm64_mojave.bottle.tar.gz
xcodes-$VERSION.macos.i386.bottle.tar.gz
xcodes-$VERSION.macos.arm64.bottle.tar.gz
Next:
1. Push the version bump commit and tag when ready:
git push --follow-tags
2. Edit the draft release created by Release Drafter to point at the new tag.
3. Set the release title to $VERSION.
4. Add the release assets listed above.
5. Publish the release.
6. Update the Homebrew bottle.
EOF