-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·83 lines (72 loc) · 2.27 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·83 lines (72 loc) · 2.27 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
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -ne 1 ]]; then
echo "Usage: ./release.sh <version> (e.g. ./release.sh 0.2.0)"
exit 1
fi
VERSION="$1"
APP_NAME="Rusty"
BUNDLE_ID="com.rusty.terminal"
BINARY="target/release/rusty"
ICON="crates/rusty-ui/assets/icon.icns"
APP_OUT="releases/$APP_NAME.app"
ZIP_OUT="releases/Rusty-macos-$VERSION.zip"
echo "==> Bumping version to $VERSION"
# Update the single workspace version — all crates inherit it.
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
echo "==> Building release binary"
cargo build --release -p rusty-app
echo "==> Assembling $APP_OUT"
rm -rf "$APP_OUT"
mkdir -p "$APP_OUT/Contents/MacOS"
mkdir -p "$APP_OUT/Contents/Resources"
cp "$BINARY" "$APP_OUT/Contents/MacOS/$APP_NAME"
cp "$ICON" "$APP_OUT/Contents/Resources/$APP_NAME.icns"
mkdir -p "$APP_OUT/Contents/Resources/completions"
cp completions-toml/*.toml "$APP_OUT/Contents/Resources/completions/"
cat > "$APP_OUT/Contents/Info.plist" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>$APP_NAME</string>
<key>CFBundleDisplayName</key>
<string>$APP_NAME</string>
<key>CFBundleIdentifier</key>
<string>$BUNDLE_ID</string>
<key>CFBundleVersion</key>
<string>$VERSION</string>
<key>CFBundleShortVersionString</key>
<string>$VERSION</string>
<key>CFBundleExecutable</key>
<string>$APP_NAME</string>
<key>CFBundleIconFile</key>
<string>$APP_NAME</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>LSUIElement</key>
<false/>
</dict>
</plist>
PLIST
echo "==> Creating $ZIP_OUT"
rm -f "$ZIP_OUT"
zip -r "$ZIP_OUT" "$APP_OUT"
echo "==> Tagging git commit"
git add Cargo.toml Cargo.lock
git commit -m "release v$VERSION"
git tag "v$VERSION"
echo ""
echo "Done!"
echo ""
echo " Bundle: $APP_OUT"
echo " Zip: $ZIP_OUT ← upload this to GitHub Releases"
echo ""
echo "Push and publish:"
echo " git push && git push --tags"
echo " gh release create v$VERSION $ZIP_OUT --title \"v$VERSION\" --generate-notes"