2222 with :
2323 node-version : 24
2424 - name : Install Rust toolchain
25- working-directory : sweetpad-lib
26- # Installs the channel + Apple targets pinned in sweetpad-lib/rust-toolchain.toml
25+ # Installs the channel + Apple targets pinned in rust-toolchain.toml
2726 run : rustup show
2827
2928 - name : Resolve version
@@ -34,16 +33,24 @@ jobs:
3433 if [[ "${GITHUB_REF:-}" == refs/tags/cli-v* ]]; then
3534 VERSION="${GITHUB_REF_NAME#cli-v}"
3635 else
37- VERSION="$(grep -m1 '^version' sweetpad-lib/ Cargo.toml | cut -d'"' -f2)-dryrun"
36+ VERSION="$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)-dryrun"
3837 fi
3938 echo "VERSION=$VERSION" >> "$GITHUB_ENV"
4039 echo "TARBALL=sweetpad-cli-$VERSION-macos-universal.tar.gz" >> "$GITHUB_ENV"
4140 echo "Building sweetpad CLI $VERSION"
4241
4342 - name : Build universal CLI
44- # Builds the bundled injection client + the universal sweetpad binary into
45- # sweetpad-lib/sweetpad-cli.
46- run : npm run build:cli:universal -w @sweetpad/lib
43+ # Build the bundled injection client, then the universal `sweetpad` binary.
44+ run : |
45+ set -euo pipefail
46+ bash sweetpad-cli/vendor/injection-client/build.sh
47+ cargo build --release --bin sweetpad --target aarch64-apple-darwin
48+ cargo build --release --bin sweetpad --target x86_64-apple-darwin
49+ mkdir -p dist
50+ lipo -create -output dist/sweetpad \
51+ target/aarch64-apple-darwin/release/sweetpad \
52+ target/x86_64-apple-darwin/release/sweetpad
53+ chmod +x dist/sweetpad
4754
4855 - name : Import Developer ID certificate
4956 env :
7077 set -euo pipefail
7178 IDENTITY="$(security find-identity -v -p codesigning "$KEYCHAIN" | awk -F'"' '/Developer ID Application/ { print $2; exit }')"
7279 test -n "$IDENTITY"
73- codesign --force --options runtime --timestamp --sign "$IDENTITY" sweetpad-lib /sweetpad-cli
74- codesign --verify --strict --verbose=2 sweetpad-lib /sweetpad-cli
80+ codesign --force --options runtime --timestamp --sign "$IDENTITY" dist /sweetpad
81+ codesign --verify --strict --verbose=2 dist /sweetpad
7582
7683 - name : Notarize the CLI
7784 env :
@@ -82,16 +89,13 @@ jobs:
8289 set -euo pipefail
8390 KEY_PATH="$RUNNER_TEMP/notary_key.p8"
8491 echo "$MACOS_NOTARY_KEY_P8" | base64 --decode > "$KEY_PATH"
85- /usr/bin/zip -j "$RUNNER_TEMP/notarize.zip" sweetpad-lib /sweetpad-cli
92+ /usr/bin/zip -j "$RUNNER_TEMP/notarize.zip" dist /sweetpad
8693 xcrun notarytool submit "$RUNNER_TEMP/notarize.zip" --key "$KEY_PATH" --key-id "$MACOS_NOTARY_KEY_ID" --issuer "$MACOS_NOTARY_ISSUER_ID" --wait
8794 rm -f "$KEY_PATH"
8895
8996 - name : Package tarball
9097 run : |
9198 set -euo pipefail
92- mkdir -p dist
93- cp sweetpad-lib/sweetpad-cli dist/sweetpad
94- chmod +x dist/sweetpad
9599 tar -C dist -czf "$TARBALL" sweetpad
96100 echo "SHA256=$(shasum -a 256 "$TARBALL" | cut -d' ' -f1)" >> "$GITHUB_ENV"
97101 shasum -a 256 "$TARBALL"
0 commit comments