Skip to content

Commit f2cbe23

Browse files
committed
clean up build steps
1 parent bc2d61f commit f2cbe23

2 files changed

Lines changed: 102 additions & 3 deletions

File tree

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ git add Sources/XcodesKit/Version.swift
208208
git commit -m "Bump version to $VERSION"
209209
git tag -asm "$VERSION" "$VERSION"
210210

211+
# Run the release automation
212+
./release.sh --version "$VERSION" --team-id "ABC123"
213+
214+
# Or run the release steps manually:
211215
# Clean first
212216
make clean
213217

@@ -216,18 +220,22 @@ make zip
216220
# Create a Homebrew bottle
217221
make bottle VERSION="$VERSION"
218222

223+
# Duplicate the Homebrew bottle for all expected platform filenames
224+
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.arm64_mojave.bottle.tar.gz"
225+
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.macos.i386.bottle.tar.gz"
226+
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.macos.arm64.bottle.tar.gz"
227+
219228
# Notarize the release build
220229
# This can take a while
221230
make notarize \
222231
TEAMID="ABC123"
223232

224-
# Push the new version bump commit and tag
233+
# Push the new version bump commit and tag when ready
225234
git push --follow-tags
226235

227236
# Edit the draft release created by Release Drafter to point at the new tag
228237
# Set the release title to the new version
229-
# Duplicate xcodes-$VERSION.mojave.tar.gz and rename to xcodes-$VERSION.arm64_mojave.tar.gz, also create `xcodes-$VERSION.macos.i386.tar.gz` and `xcodes-$VERSION.macos.arm64.tar.gz`
230-
# Add the xcodes.zip, xcodes-$VERSION.mojave.tar.gz, xcodes-$VERSION.arm64_mojave.tar.gz files to the release
238+
# Add the xcodes.zip and xcodes-$VERSION.*.bottle.tar.gz files to the release
231239
# Publish the release
232240

233241
# Update the Homebrew Bottle: https://github.com/XcodesOrg/homebrew-made/blob/master/Formula/xcodes.rb

release.sh

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
usage() {
6+
cat <<'EOF'
7+
Usage:
8+
./release.sh --version VERSION --team-id TEAM_ID
9+
./release.sh VERSION TEAM_ID
10+
11+
Runs the release build steps starting at `make clean`.
12+
EOF
13+
}
14+
15+
VERSION=""
16+
TEAMID=""
17+
18+
while [[ $# -gt 0 ]]; do
19+
case "$1" in
20+
-v|--version)
21+
VERSION="${2:-}"
22+
shift 2
23+
;;
24+
-t|--team-id)
25+
TEAMID="${2:-}"
26+
shift 2
27+
;;
28+
-h|--help)
29+
usage
30+
exit 0
31+
;;
32+
-*)
33+
echo "Unknown option: $1" >&2
34+
usage >&2
35+
exit 1
36+
;;
37+
*)
38+
if [[ -z "$VERSION" ]]; then
39+
VERSION="$1"
40+
elif [[ -z "$TEAMID" ]]; then
41+
TEAMID="$1"
42+
else
43+
echo "Unexpected argument: $1" >&2
44+
usage >&2
45+
exit 1
46+
fi
47+
shift
48+
;;
49+
esac
50+
done
51+
52+
if [[ -z "$VERSION" || -z "$TEAMID" ]]; then
53+
usage >&2
54+
exit 1
55+
fi
56+
57+
echo "Cleaning build artifacts"
58+
make clean
59+
60+
echo "Creating signed zip"
61+
make zip
62+
63+
echo "Creating Homebrew bottle for $VERSION"
64+
make bottle VERSION="$VERSION"
65+
66+
echo "Duplicating bottle for expected platform filenames"
67+
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.arm64_mojave.bottle.tar.gz"
68+
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.macos.i386.bottle.tar.gz"
69+
cp "xcodes-$VERSION.mojave.bottle.tar.gz" "xcodes-$VERSION.macos.arm64.bottle.tar.gz"
70+
71+
echo "Notarizing release build with team ID $TEAMID"
72+
make notarize TEAMID="$TEAMID"
73+
74+
cat <<EOF
75+
76+
Release assets are ready:
77+
xcodes.zip
78+
xcodes-$VERSION.mojave.bottle.tar.gz
79+
xcodes-$VERSION.arm64_mojave.bottle.tar.gz
80+
xcodes-$VERSION.macos.i386.bottle.tar.gz
81+
xcodes-$VERSION.macos.arm64.bottle.tar.gz
82+
83+
Next:
84+
1. Push the version bump commit and tag when ready:
85+
git push --follow-tags
86+
2. Edit the draft release created by Release Drafter to point at the new tag.
87+
3. Set the release title to $VERSION.
88+
4. Add the release assets listed above.
89+
5. Publish the release.
90+
6. Update the Homebrew bottle.
91+
EOF

0 commit comments

Comments
 (0)