Run byre and the app on their own embedded Tailscale nodes
This commit is contained in:
+18
-3
@@ -8,21 +8,34 @@ app=$build/Byre.app
|
||||
svg=$mac/icon.svg
|
||||
icns=$build/byre.icns
|
||||
identity="Developer ID Application"
|
||||
libtailscale=d1dc45d039edb7759ecbee6ba2aea0c4bca884b8
|
||||
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/"
|
||||
kit=$2/libtailscale-$7
|
||||
if [ ! -d "$kit/TailscaleKit.xcframework" ]; then
|
||||
rm -rf "$kit"
|
||||
git clone --quiet https://github.com/tailscale/libtailscale "$kit"
|
||||
git -C "$kit" checkout --quiet "$7"
|
||||
make -C "$kit/swift" macos XCPRETTIFIER=cat
|
||||
xcodebuild -create-xcframework -framework "$kit/swift/build/Build/Products/Release/TailscaleKit.framework" -output "$kit/TailscaleKit.xcframework"
|
||||
fi
|
||||
rsync -rlc --delete --exclude /mac/.build --exclude /mac/Frameworks --exclude /hands/.build "$1/mac" "$1/api" "$1/hands" "$2/"
|
||||
rm -rf "$2/mac/Frameworks"
|
||||
mkdir -p "$2/mac/Frameworks"
|
||||
ditto "$kit/TailscaleKit.xcframework" "$2/mac/Frameworks/TailscaleKit.xcframework"
|
||||
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"
|
||||
cp "$2/mac/.build/release/byre-update" "$6"
|
||||
rm -rf "$5"
|
||||
rm -rf "$5" "$8"
|
||||
ditto "$2/mac/.build/release/Sparkle.framework" "$5"
|
||||
' sh "$root" "$shared" "$build/Byre" "$build/byre-hands" "$build/Sparkle.framework" "$build/byre-update"
|
||||
ditto "$2/mac/.build/release/TailscaleKit.framework" "$8"
|
||||
' sh "$root" "$shared" "$build/Byre" "$build/byre-hands" "$build/Sparkle.framework" "$build/byre-update" "$libtailscale" "$build/TailscaleKit.framework"
|
||||
go -C "$root" build -trimpath -o "$build/server/byre" ./cmd/byre
|
||||
if [ ! "$icns" -nt "$svg" ]; then
|
||||
iconset=$build/byre.iconset
|
||||
@@ -43,6 +56,7 @@ cp "$build/server/byre" "$app/Contents/Helpers/byre"
|
||||
cp "$build/byre-hands" "$app/Contents/Helpers/byre-hands"
|
||||
cp "$build/byre-update" "$app/Contents/Helpers/byre-update"
|
||||
ditto "$build/Sparkle.framework" "$app/Contents/Frameworks/Sparkle.framework"
|
||||
ditto "$build/TailscaleKit.framework" "$app/Contents/Frameworks/TailscaleKit.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 "$version" "$app/Contents/Info.plist"
|
||||
@@ -60,6 +74,7 @@ sign --identifier run.fc.byre --entitlements "$mac/automation.entitlements" "$ap
|
||||
sign "$sparkle/Versions/B/Autoupdate"
|
||||
sign "$sparkle/Versions/B/Updater.app"
|
||||
sign "$sparkle"
|
||||
sign "$app/Contents/Frameworks/TailscaleKit.framework"
|
||||
sign --identifier run.fc.byre.update "$app/Contents/Helpers/byre-update"
|
||||
sign --entitlements "$mac/byre.entitlements" "$app"
|
||||
echo "$app"
|
||||
|
||||
Reference in New Issue
Block a user