Add signed, notarized releases with the server inside the app
This commit is contained in:
+27
-6
@@ -7,14 +7,22 @@ build=$mac/.build
|
||||
app=$build/byre.app
|
||||
svg=$mac/icon.svg
|
||||
icns=$build/byre.icns
|
||||
identity="Developer ID Application"
|
||||
mkdir -p "$shared" "$build"
|
||||
if [ "$(security cms -D -i "$mac/byre.provisionprofile" | plutil -extract ProvisionsAllDevices raw -)" != true ]; then
|
||||
echo "bundle: mac/byre.provisionprofile is not a Developer ID profile" >&2
|
||||
exit 1
|
||||
fi
|
||||
lockf -k "$shared.lock" sh -ec '
|
||||
rsync -rlc --delete --exclude /mac/.build --exclude /hands/.build "$1/mac" "$1/api" "$1/hands" "$2/"
|
||||
swift build --package-path "$2/mac" --configuration release --no-color-diagnostics
|
||||
swift build --package-path "$2/hands" --configuration release --no-color-diagnostics
|
||||
cp "$2/mac/.build/release/Byre" "$3"
|
||||
cp "$2/hands/.build/release/byre-hands" "$4"
|
||||
' sh "$root" "$shared" "$build/Byre" "$build/byre-hands"
|
||||
rm -rf "$5"
|
||||
ditto "$2/mac/.build/release/Sparkle.framework" "$5"
|
||||
' sh "$root" "$shared" "$build/Byre" "$build/byre-hands" "$build/Sparkle.framework"
|
||||
go -C "$root" build -trimpath -o "$build/server/byre" ./cmd/byre
|
||||
if [ ! "$icns" -nt "$svg" ]; then
|
||||
iconset=$build/byre.iconset
|
||||
rm -rf "$iconset"
|
||||
@@ -25,17 +33,30 @@ if [ ! "$icns" -nt "$svg" ]; then
|
||||
done
|
||||
iconutil --convert icns --output "$icns" "$iconset"
|
||||
fi
|
||||
version=$(git -C "$root" describe --tags --always)
|
||||
version=${version#v}
|
||||
rm -rf "$app"
|
||||
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources/fonts"
|
||||
mkdir -p "$app/Contents/MacOS" "$app/Contents/Helpers" "$app/Contents/Frameworks" "$app/Contents/Resources/fonts"
|
||||
cp "$build/Byre" "$app/Contents/MacOS/Byre"
|
||||
cp "$build/byre-hands" "$app/Contents/MacOS/byre-hands"
|
||||
codesign --force --sign "Apple Development" --identifier run.fc.byre.hands "$app/Contents/MacOS/byre-hands"
|
||||
cp "$build/server/byre" "$app/Contents/Helpers/byre"
|
||||
cp "$build/byre-hands" "$app/Contents/Helpers/byre-hands"
|
||||
ditto "$build/Sparkle.framework" "$app/Contents/Frameworks/Sparkle.framework"
|
||||
cp "$mac/Info.plist" "$app/Contents/Info.plist"
|
||||
plutil -insert ByreCommit -string "$(git -C "$root" rev-parse HEAD)" "$app/Contents/Info.plist"
|
||||
plutil -insert CFBundleShortVersionString -string "$(git -C "$root" rev-parse --short HEAD)" "$app/Contents/Info.plist"
|
||||
plutil -insert CFBundleShortVersionString -string "$version" "$app/Contents/Info.plist"
|
||||
plutil -insert CFBundleVersion -string "$(git -C "$root" rev-list --count HEAD)" "$app/Contents/Info.plist"
|
||||
cp "$mac"/fonts/*.woff2 "$app/Contents/Resources/fonts/"
|
||||
cp "$icns" "$app/Contents/Resources/byre.icns"
|
||||
cp "$mac/byre.provisionprofile" "$app/Contents/embedded.provisionprofile"
|
||||
codesign --force --sign "Apple Development" --entitlements "$mac/byre.entitlements" "$app"
|
||||
sparkle=$app/Contents/Frameworks/Sparkle.framework
|
||||
rm -rf "$sparkle/Versions/B/XPCServices"
|
||||
sign() {
|
||||
codesign --force --timestamp --options runtime --sign "$identity" "$@"
|
||||
}
|
||||
sign --identifier run.fc.byre.hands --entitlements "$mac/automation.entitlements" "$app/Contents/Helpers/byre-hands"
|
||||
sign --identifier run.fc.byre --entitlements "$mac/automation.entitlements" "$app/Contents/Helpers/byre"
|
||||
sign "$sparkle/Versions/B/Autoupdate"
|
||||
sign "$sparkle/Versions/B/Updater.app"
|
||||
sign "$sparkle"
|
||||
sign --entitlements "$mac/byre.entitlements" "$app"
|
||||
echo "$app"
|
||||
|
||||
Reference in New Issue
Block a user