Updates unxip to be universal. Updates experiment icon to support OS11

This commit is contained in:
Matt Kiazyk 2022-03-18 09:05:20 -05:00
parent 9fc2c7aaf6
commit f665054c7f
No known key found for this signature in database
GPG key ID: 850581D2373E4A99
7 changed files with 48 additions and 38 deletions

View file

@ -48,10 +48,24 @@ You'll need macOS 11 Big Sur and Xcode 12 in order to build and run Xcodes.app.
If you aren't a Robots and Pencils employee you'll need to change the CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT build setting to your Apple Developer team ID in order for code signing validation to succeed between the main app and the privileged helper.
`Unxip` and `aria2` must be compiled as a universal binary
```
# compile for Intel
swiftc -parse-as-library -O -target x86_64-apple-macos11 unxip.swift
# compile for M1
swiftc -parse-as-library -O -target arm64-apple-macos11 unxip.swift
# combine for universal binary
lipo -create -output unxip unxip_intel unxip_m1
# check it
lipo -archs unxip
```
Notable design decisions are recorded in [DECISIONS.md](./DECISIONS.md). The Apple authentication flow is described in [Apple.paw](./Apple.paw), which will allow you to play with the API endpoints that are involved using the [Paw](https://paw.cloud) app.
[`xcode-install`](https://github.com/xcpretty/xcode-install) and [fastlane/spaceship](https://github.com/fastlane/fastlane/tree/master/spaceship) both deserve credit for figuring out the hard parts of what makes this possible.
<details>
<summary>Releasing a new version</summary>

View file

@ -17,46 +17,39 @@
# https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow
# Adapted from https://github.com/keybase/client/blob/46f5df0aa64ff19198ba7b044bbb7cd907c0be9f/packaging/desktop/package_darwin.sh
username="$1"
password="$2"
asc_provider="$3"
file="$4"
file="$1"
team_id="$2"
echo "Uploading to notarization service"
uuid=$(xcrun altool \
--notarize-app \
--primary-bundle-id "com.robotsandpencils.XcodesApp.zip" \
--username "$username" \
--password "$password" \
--asc-provider "$asc_provider" \
--file "$file" 2>&1 | \
grep 'RequestUUID' | \
awk '{ print $3 }')
result=$(xcrun notarytool submit "$file" \
--keychain-profile "AC_PASSWORD" \
--team-id "$team_id" \
--wait)
# echo "done1"
echo $result
# My grep/awk is bad and I can't figure out how to get the UUID out properly
# uuid=$("$result" | \
# grep 'id:' | tail -n1 | \
# cut -d":" -f2-)
echo "Successfully uploaded to notarization service, polling for result: $uuid"
sleep 15
while :
do
fullstatus=$(xcrun altool \
--notarization-info "$uuid" \
--username "$username" \
--password "$password" \
--asc-provider "$asc_provider" 2>&1)
status=$(echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }')
if [ "$status" = "success" ]; then
echo "Notarization success"
exit 0
elif [ "$status" = "in" ]; then
echo "Notarization still in progress, sleeping for 15 seconds and trying again"
sleep 15
else
echo "Notarization failed, full status below"
echo "$fullstatus"
exit 1
fi
done
# we should check here using the info (or notarytool log) to check the results and log
#
# fullstatus=$(xcrun notarytool info "$uuid" \
# --keychain-profile "AC_PASSWORD" 2>&1)
# status=$(echo "$fullstatus" | grep 'status\:' | awk '{ print $2 }')
# if [ "$status" = "Accepted" ]; then
# echo "Notarization success"
# exit 0
# else
# echo "Notarization failed, full status below"
# echo "$fullstatus"
# exit 1
# fi
# Remove .zip
rm $file
@ -66,4 +59,4 @@ app_path="$(basename -s ".zip" "$file").app"
xcrun stapler staple "$app_path"
# Zip the stapled app for distribution
ditto -c -k --sequesterRsrc --keepParent "$file" "$app_path"
ditto -c -k --sequesterRsrc --keepParent "$app_path" "$file"

View file

@ -10,6 +10,9 @@ PROJECT_DIR=$(pwd)/$PROJECT_NAME/Resources
SCRIPTS_DIR=$(pwd)/Scripts
INFOPLIST_FILE="Info.plist"
# If needed ensure that the unxip binary is signed with a hardened runtime so we can notarize
# codesign --force --options runtime --sign "Developer ID Application: Robots and Pencils Inc." $PROJECT_DIR/unxip
# Ensure a clean build
rm -rf Archive/*
rm -rf Product/*

View file

@ -29,7 +29,7 @@ struct AboutView: View {
}
Color.clear
.frame(width: 300, height: 0)
Label("Unxip Experiment", systemImage: "testtube.2")
Label("Unxip Experiment", systemImage: "lightbulb")
HStack(spacing: 32) {
Button(action: {
openURL(URL(string: "https://github.com/saagarjha/unxip/")!)

View file

@ -27,7 +27,7 @@ struct PreferencesView: View {
.tag(Tabs.advanced)
ExperimentsPreferencePane()
.tabItem {
Label("Experiments", systemImage: "testtube.2")
Label("Experiments", systemImage: "lightbulb")
}
.tag(Tabs.experiment)
}

View file

@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf2636
{\rtf1\ansi\ansicpg1252\cocoartf2638
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}

Binary file not shown.