Skip to content

armgit / cra

Public Imported from GitHub
0

The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.

Install path for unsigned builds: curl installer, fixed asset names

Victor78cc2062b368
diff --git a/.github/release-notes-unsigned.md b/.github/release-notes-unsigned.md
new file mode 100644
index 0000000..9119c72
--- /dev/null
+++ b/.github/release-notes-unsigned.md
@@ -0,0 +1,18 @@
+## Install
+
+**Easiest: paste this into Terminal** (Applications → Utilities → Terminal)
+
+```sh
+curl -fsSL https://raw.githubusercontent.com/VictorKildahl/cra/main/scripts/install.sh | bash
+```
+
+It puts Cra in your Applications folder and opens it, with no security prompts. Run the same line again any time to update.
+
+**Or download `Cra.dmg` below**
+
+1. Open `Cra.dmg` and drag Cra to Applications.
+2. Open Cra. macOS says it could not verify the app. Click **Done**.
+3. Open **System Settings → Privacy & Security**, scroll down, and click **Open Anyway** next to "Cra was blocked".
+4. Confirm with Touch ID or your password, then click **Open Anyway** once more.
+
+You only do this once. Cra is an early, independent open-source project and is not notarized by Apple yet; every line of it is in this repository.
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1f89c16..7e137e6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -2,7 +2,7 @@ name: Release
# Cut a release by pushing a tag: git tag v0.1.0 && git push origin v0.1.0
# Signing and notarization run when the secrets below exist; otherwise the
-# job publishes an ad-hoc build marked as a pre-release.
+# job publishes an ad-hoc build with install steps from release-notes-unsigned.md.
#
# Secrets (Settings → Secrets and variables → Actions):
# MACOS_CERTIFICATE_P12 base64 of the Developer ID Application .p12
@@ -88,11 +88,15 @@ jobs:
GH_TOKEN: ${{ github.token }}
SIGNED: ${{ steps.cert.outputs.signed == 'true' }}
run: |
- NOTES="Cra ${CRA_VERSION} for macOS 14 and later (Apple silicon)."
- FLAGS=()
- if [ "$SIGNED" != "true" ]; then
- FLAGS+=(--prerelease)
- NOTES="$NOTES"$'\n\n'"This build is ad-hoc signed and not notarized. On first launch, right-click Cra and choose Open."
+ NOTES="$RUNNER_TEMP/notes.md"
+ echo "Cra ${CRA_VERSION} for macOS 14 and later (Apple silicon)." > "$NOTES"
+ echo >> "$NOTES"
+ # Unsigned builds stay regular releases: releases/latest (the website and
+ # scripts/install.sh) skips pre-releases.
+ if [ "$SIGNED" = "true" ]; then
+ echo "Download \`Cra.dmg\` below, open it and drag Cra to Applications." >> "$NOTES"
+ else
+ cat .github/release-notes-unsigned.md >> "$NOTES"
fi
gh release create "${{ github.ref_name }}" build/dist/* \
- --title "Cra ${CRA_VERSION}" --notes "$NOTES" --verify-tag "${FLAGS[@]}"
+ --title "Cra ${CRA_VERSION}" --notes-file "$NOTES" --verify-tag
diff --git a/README.md b/README.md
index 6569484..75ad2ba 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,28 @@ searches open and archived tabs, auto-archiving, folders, and Chrome DevTools.
Shell: Swift (AppKit + SwiftUI). Engine: Chromium Embedded Framework.
+## Install
+
+Needs macOS 14 or later on Apple silicon.
+
+**Easiest: paste this into Terminal** (Applications → Utilities → Terminal)
+
+ curl -fsSL https://raw.githubusercontent.com/VictorKildahl/cra/main/scripts/install.sh | bash
+
+It puts Cra in your Applications folder and opens it, with no security prompts. Run
+the same line again any time to update.
+
+**Or download [Cra.dmg](https://github.com/VictorKildahl/cra/releases/latest/download/Cra.dmg)**
+
+1. Open `Cra.dmg` and drag Cra to Applications.
+2. Open Cra. macOS says it could not verify the app. Click **Done**.
+3. Open **System Settings → Privacy & Security**, scroll down, and click **Open Anyway**
+ next to "Cra was blocked".
+4. Confirm with Touch ID or your password, then click **Open Anyway** once more.
+
+You only do this once. Cra is not notarized by Apple yet; every line of it is in this
+repository.
+
## Build
scripts/build.sh # fetches CEF on first run, builds build/Cra.app
diff --git a/docs/release.md b/docs/release.md
index 8adb81f..c758b38 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -29,7 +29,25 @@ Everything is scripted; the only manual part is obtaining the certificate once.
| `APPLE_APP_PASSWORD` | the app-specific password |
Until these exist the Release workflow still runs: it publishes an ad-hoc build as a
-pre-release with a note about right-clicking to open.
+regular release (pre-releases are invisible to `releases/latest`) with the install
+steps in `.github/release-notes-unsigned.md`.
+
+## Installing unsigned builds
+
+Gatekeeper only checks files carrying the quarantine flag, which browsers set and curl
+does not. So the friction-free path for an ad-hoc build is `scripts/install.sh`, run as
+
+```sh
+curl -fsSL https://raw.githubusercontent.com/VictorKildahl/cra/main/scripts/install.sh | bash
+```
+
+It downloads `releases/latest/download/Cra.zip`, replaces the app in `/Applications`
+(or `~/Applications`), quitting a running Cra first, and opens it. Rerunning it updates.
+
+The DMG path needs one manual approval: open Cra, click Done on the "could not verify"
+dialog, then System Settings → Privacy & Security → Open Anyway. Right-click → Open no
+longer bypasses Gatekeeper since macOS 15. The README, release notes and the website's
+download page all carry both paths; keep them in step.
## Cutting a release
@@ -40,8 +58,9 @@ git tag v0.1.0
git push origin v0.1.0
```
-Artifacts land on the GitHub release: `Cra-0.1.0.dmg`, `Cra-0.1.0.zip`, `SHA256SUMS.txt`.
-The website's download button points at `releases/latest`.
+Artifacts land on the GitHub release: `Cra.dmg`, `Cra.zip`, `SHA256SUMS.txt`. The names
+carry no version so `releases/latest/download/Cra.dmg` always resolves; the website's
+download button and `scripts/install.sh` rely on that.
## Locally
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000..c7dfe8e
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+# Installs or updates Cra from the latest GitHub release.
+# curl -fsSL https://raw.githubusercontent.com/VictorKildahl/cra/main/scripts/install.sh | bash
+# Files downloaded with curl carry no quarantine flag, so macOS opens the
+# unnotarized build without the Gatekeeper prompt a browser download triggers.
+# Overrides: CRA_DOWNLOAD_URL (zip to install), CRA_INSTALL_DIR, CRA_NO_OPEN=1.
+set -euo pipefail
+
+say() { printf '\033[1m%s\033[0m\n' "$*"; }
+fail() { printf '\033[31m%s\033[0m\n' "$*" >&2; exit 1; }
+
+# Everything runs from main so a partially downloaded script never executes.
+main() {
+ local url="${CRA_DOWNLOAD_URL:-https://github.com/VictorKildahl/cra/releases/latest/download/Cra.zip}"
+ local dir="${CRA_INSTALL_DIR:-}"
+
+ [ "$(uname -s)" = Darwin ] || fail "Cra runs on macOS only."
+ [ "$(uname -m)" = arm64 ] || fail "Cra needs a Mac with Apple silicon (M1 or later)."
+ [ "$(sw_vers -productVersion | cut -d. -f1)" -ge 14 ] || fail "Cra needs macOS 14 Sonoma or later."
+
+ if [ -z "$dir" ]; then
+ if [ -w /Applications ]; then dir=/Applications; else dir="$HOME/Applications"; fi
+ fi
+ mkdir -p "$dir"
+
+ TMP="$(mktemp -d)"
+ trap 'rm -rf "$TMP"' EXIT
+
+ say "Downloading Cra…"
+ curl -fL --progress-bar -o "$TMP/Cra.zip" "$url" || fail "The download failed. Check your connection and run the command again."
+ ditto -x -k "$TMP/Cra.zip" "$TMP" || fail "The download was damaged. Run the command again."
+ [ -d "$TMP/Cra.app" ] || fail "The download did not contain Cra.app."
+
+ if pgrep -xq Cra; then
+ say "Quitting Cra to update it…"
+ osascript -e 'quit app "Cra"' >/dev/null 2>&1 || true
+ for _ in $(seq 20); do pgrep -xq Cra || break; sleep 0.5; done
+ pgrep -xq Cra && fail "Cra is still running. Quit it and run the command again."
+ fi
+
+ rm -rf "$dir/Cra.app"
+ mv "$TMP/Cra.app" "$dir/"
+ xattr -dr com.apple.quarantine "$dir/Cra.app" 2>/dev/null || true
+
+ say "Cra is installed in $dir. Run this command again any time to update."
+ [ -n "${CRA_NO_OPEN:-}" ] || open "$dir/Cra.app"
+}
+
+main "$@"
diff --git a/scripts/package.sh b/scripts/package.sh
index ff29573..5e94cfb 100755
--- a/scripts/package.sh
+++ b/scripts/package.sh
@@ -11,8 +11,8 @@ IDENTITY="${CRA_SIGN_IDENTITY:--}"
DIST="build/dist"
rm -rf "$DIST" && mkdir -p "$DIST"
-ZIP="$DIST/Cra-$VERSION.zip"
-DMG="$DIST/Cra-$VERSION.dmg"
+ZIP="$DIST/Cra.zip"
+DMG="$DIST/Cra.dmg"
# Zip: ditto keeps resource forks and symlinks, which codesign requires.
ditto -c -k --keepParent "$APP" "$ZIP"
diff --git a/scripts/release.sh b/scripts/release.sh
index fcd55b8..900893f 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -22,10 +22,10 @@ fi
scripts/package.sh "$APP"
if [ "$IDENTITY" != "-" ]; then
- scripts/notarize.sh "build/dist/Cra-$CRA_VERSION.dmg"
+ scripts/notarize.sh "build/dist/Cra.dmg"
# Re-zip the stapled app so the zip download carries the ticket too.
- ditto -c -k --keepParent "$APP" "build/dist/Cra-$CRA_VERSION.zip"
- (cd build/dist && shasum -a 256 "Cra-$CRA_VERSION.zip" "Cra-$CRA_VERSION.dmg" > SHA256SUMS.txt)
+ ditto -c -k --keepParent "$APP" "build/dist/Cra.zip"
+ (cd build/dist && shasum -a 256 Cra.zip Cra.dmg > SHA256SUMS.txt)
spctl --assess --type execute --verbose=2 "$APP" && echo "Gatekeeper accepts $APP"
else
echo "Ad-hoc build: not notarized. Set CRA_SIGN_IDENTITY and notary credentials for a distributable build." >&2