From 5b91b08c4aedd8ba73fa867b44e52957d9e0b4ce Mon Sep 17 00:00:00 2001 From: Daniel Villalobos Date: Tue, 24 Nov 2026 18:28:32 +0100 Subject: [PATCH 1/3] Publish the signed macOS app and its Homebrew cask with every release --- .github/workflows/release.yml | 57 ++++++++++++++++++++++++++--------- CHANGELOG.md | 1 + README.md | 16 ++++++++-- packaging/README.md | 24 ++++++++++++--- scripts/package-metadata.py | 48 +++++++++++++++++++++++++++++ scripts/test_packaging.py | 48 +++++++++++++++++++++++++++++ 6 files changed, 173 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d59b77..b6b7b12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: dist/*.deb metadata: - needs: build + needs: [build, macos-app] runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -70,16 +70,19 @@ jobs: path: dist pattern: '!*.dockerbuild' merge-multiple: true + # The cask (refract-app) is generated from the signed disk images macos-app built in this run. - name: Homebrew and WinGet run: | python3 scripts/package-metadata.py "$GITHUB_REF_NAME" dist "$RUNNER_TEMP/packages" cp "$RUNNER_TEMP/packages/homebrew/refract.rb" dist/refract.rb + cp "$RUNNER_TEMP/packages/homebrew/refract-app.rb" dist/refract-app.rb tar -czf dist/refract-winget-manifests.tar.gz -C "$RUNNER_TEMP/packages/winget" manifests - uses: actions/upload-artifact@v7 with: name: package-metadata path: | dist/refract.rb + dist/refract-app.rb dist/refract-winget-manifests.tar.gz # Tool archives (Tectonic, SyncTeX, ripgrep, private Git) for every target, built @@ -89,6 +92,26 @@ jobs: with: tag: ${{ github.ref_name }} + # The macOS app (#71): Refract.app with the tool archives above, signed, notarized and stapled, + # its disk image (Refract-.dmg, the download people use) and the update archive and feed + # (Refract-.zip, appcast-.xml). A release never ships an app signed ad hoc: without + # the signing secrets, or if signing or notarization fails, this job fails and nothing is published. + macos-app: + needs: tools + uses: ./.github/workflows/macos-app.yml + with: + version: ${{ github.ref_name }} + require-signed: true + tools-artifact: true + secrets: + MACOS_CERT_P12_BASE64: ${{ secrets.MACOS_CERT_P12_BASE64 }} + MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }} + MACOS_SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }} + NOTARY_KEY_P8_BASE64: ${{ secrets.NOTARY_KEY_P8_BASE64 }} + NOTARY_KEY_ID: ${{ secrets.NOTARY_KEY_ID }} + NOTARY_ISSUER_ID: ${{ secrets.NOTARY_ISSUER_ID }} + SPARKLE_ED_PRIVATE_KEY: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }} + # Exercise the CLI without any server configuration or LaTeX tools. OAuth # itself is interactive; --help checks the login entry point without signing in. cli-smoke: @@ -132,7 +155,7 @@ jobs: # Waits for the image's scan, so a blocked image stops the whole release, # and attaches each architecture's scan report. release: - needs: [build, metadata, cli-smoke, tools, image] + needs: [build, metadata, cli-smoke, tools, macos-app, image] runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # for CHANGELOG.md @@ -151,22 +174,18 @@ jobs: # architecture, each pointing at an archive this release attaches. A feed that points anywhere # else would send people's apps to the wrong file, so it stops here. Feeds are looked up at # releases/latest/download/appcast-.xml: publish them as assets of a full (not pre-)release. - # A full release that attaches the app must carry both feeds (checked below); until the app is - # part of every release (#71), one without the app has none and is allowed. + # A full release must carry both feeds (checked below); a prerelease has none. - name: Check the appcasts run: | set -- dist/appcast-*.xml if [ ! -e "$1" ]; then - # Installed apps read releases/latest/download/appcast-.xml: a full release that - # carries the app (Refract-.zip) but no appcast would become "latest" and break - # every installed app's feed (404). Only a prerelease (a '-' in the tag) may go without. + # Installed apps read releases/latest/download/appcast-.xml: a full release without + # them would become "latest" and break every installed app's feed (404). Only a + # prerelease (a '-' in the tag) goes without. case "$GITHUB_REF_NAME" in *-*) echo "no appcasts in this prerelease"; exit 0 ;; esac - if ls dist/Refract-arm64.zip dist/Refract-amd64.zip >/dev/null 2>&1; then - echo "::error::this release attaches the macOS app but no appcast-.xml: as the latest release it would break every installed app's update feed"; exit 1 - fi - echo "no appcasts in this release (it has no macOS app)"; exit 0 + echo "::error::this release attaches the macOS app but no appcast-.xml: as the latest release it would break every installed app's update feed"; exit 1 fi for arch in arm64 amd64; do [ -f "dist/appcast-$arch.xml" ] || { echo "::error::appcast-$arch.xml is missing: an app of that architecture could never update"; exit 1; } @@ -184,6 +203,15 @@ jobs: *) echo "::error::$f points at ${url##*/}, an archive of another architecture"; exit 1 ;; esac done + # Every release carries the macOS app: its disk image (what people download), and the zip + # the update feeds point at, for both architectures. + - name: Check the macOS app + run: | + for arch in arm64 amd64; do + for f in "Refract-$arch.dmg" "Refract-$arch.zip"; do + [ -f "dist/$f" ] || { echo "::error::$f is missing from this release"; exit 1; } + done + done # The notes are the version's section of CHANGELOG.md ("## [0.1.0] - …"), # minus the link definitions at the end of the file. Without that # section, GitHub lists the commits instead. @@ -221,12 +249,13 @@ jobs: - name: Update tap working-directory: tap run: | - mkdir -p Formula + mkdir -p Formula Casks cp ../metadata/refract.rb Formula/refract.rb - if git diff --quiet -- Formula/refract.rb && [ -z "$(git ls-files --others --exclude-standard Formula/refract.rb)" ]; then exit 0; fi + cp ../metadata/refract-app.rb Casks/refract-app.rb + if git diff --quiet -- Formula Casks && [ -z "$(git ls-files --others --exclude-standard Formula Casks)" ]; then exit 0; fi git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git add Formula/refract.rb + git add Formula/refract.rb Casks/refract-app.rb git commit -m "Refract $GITHUB_REF_NAME" git push diff --git a/CHANGELOG.md b/CHANGELOG.md index dc30280..3506714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Notable changes to Refract. The format follows [Keep a Changelog](https://keepac ### Added +- The macOS app is part of every release: a signed and notarized disk image per architecture (`Refract-arm64.dmg`, `Refract-amd64.dmg`) with its update feed, and a Homebrew cask (`brew install --cask ponytojas/tap/refract-app`). A release fails instead of publishing an app that isn't signed and notarized. Uninstalling the app, even with `--zap`, keeps your projects and key. - Refract can read its encryption key, OpenID Connect client secret, SMTP URL and OpenAlex API key from files using the corresponding `REFRACT_*_FILE` variables. `refract users` and `refract local` also accept the encryption key from a file, and the systemd unit starts Refract directly with a systemd credential. - `REFRACT_OUTBOUND` (`any` by default, or `public`) chooses whether AI provider base URLs and git remotes may reach loopback and private networks. `public` does what `REFRACT_MODE=saas` did for outbound requests, and checks at startup that git is 2.37 or later. With `public`, provider requests and redirects must be https, and link-local git remotes are refused in every mode. `REFRACT_MODE=saas` no longer changes it. - Refract finds `tectonic`, `synctex`, `rg` and `git` in a bundled `libexec/refract` folder next to the executable (the executable's own folder on Windows) before the `PATH`, and runs them by absolute path; a bundled Git uses only its own helpers and templates. `REFRACT_TECTONIC_BIN`, `REFRACT_SYNCTEX_BIN`, `REFRACT_RG_BIN` and `REFRACT_GIT_BIN` override the lookup. The startup log shows where each was found, and the web app shows one notice when a tool is missing, saying what won't work, on whichever page opens first. On macOS and Linux a bundled tool in a folder that others can write, or that another user owns, is ignored. The same checks cover bundled Git's helpers and templates. diff --git a/README.md b/README.md index 9b199bc..30f79fd 100644 --- a/README.md +++ b/README.md @@ -143,10 +143,20 @@ The paper in these screenshots is a made-up example, and the AI responses come f ## Quick start -Try Refract on your own computer in a few minutes, either with the `refract` program or with Docker. +Try Refract on your own computer in a few minutes: with the Mac app, the `refract` program or Docker. > **Using an AI coding agent?** Ask it to follow [AGENTS.md](AGENTS.md): a step-by-step guide for agents to get Refract running for you, whether you want to try it, work on the code or put it on a server. +### The Mac app + +Download the disk image for your Mac from the [latest release](https://github.com/ponytojas/Refract/releases/latest): [Apple silicon](https://github.com/ponytojas/Refract/releases/latest/download/Refract-arm64.dmg) or [Intel](https://github.com/ponytojas/Refract/releases/latest/download/Refract-amd64.dmg) (**Apple menu → About This Mac** says which). Open it and drag **Refract** to **Applications**. Or with Homebrew: + +```sh +brew install --cask ponytojas/tap/refract-app +``` + +It needs macOS 13 or later and nothing else: Git, Tectonic, SyncTeX and ripgrep come inside the app, and the first PDF compiles offline. The app is signed and notarized, and updates itself (**Refract → Check for Updates…**). Your projects live in `~/Library/Application Support/Refract` and the key that protects stored passwords in the Keychain, outside the app: updating, or removing the app (even `brew uninstall --zap`), leaves them. Signing in to ChatGPT or adding an API key in **Settings → Assistant** is optional. The Homebrew formula `refract` is still the command line; the app is the cask `refract-app`. + ### Run it on your computer [Install the `refract` program](#install-the-cli), plus [Tectonic](https://tectonic-typesetting.github.io/book/latest/installation/) to compile and git for project history, then run: @@ -717,7 +727,9 @@ Each architecture's image is pushed by digest only, with no public tag, and then - **Recording an exception.** Add an entry with the vulnerability's id (as Grype reports it), the package, the reason it can't be exploited in Refract (or why waiting for a fix is acceptable), your GitHub login and the dates of the review and of expiry (at most 90 days apart). Merge it through a pull request like any other change. An expired or incomplete entry blocks the gate until someone reviews it again. - **The report.** It stays with the build: each architecture's `refract-image---scan.tar.gz` has `report.md` (the decision, the findings and the native tools), both SBOMs, Grype's full results and `image.txt` with the digest it covers. It is attached to the GitHub release and kept for 90 days as a workflow artifact, also when the scan blocks. Run it locally with `scripts/scan-image.sh `. -Releases also include Debian packages for amd64 and arm64, a Homebrew formula (`refract.rb`) and WinGet manifests (`refract-winget-manifests.tar.gz`). CLI smoke tests run on macOS, Linux and Windows before the release is published. Stable releases can update the Homebrew tap automatically once its repository token is configured. [Packaging maintenance](packaging/README.md) describes the setup and manual publication steps. +Every release also carries the macOS app for both architectures (`.github/workflows/macos-app.yml`, called by the release): the signed, notarized and stapled `Refract-.dmg` people download, the `Refract-.zip` and `appcast-.xml` the app updates from. The release fails rather than publish an app signed ad hoc, so the signing, notarization and update secrets must be set ([macos/README.md](macos/README.md#signing-and-notarization)). + +Releases also include Debian packages for amd64 and arm64, a Homebrew formula (`refract.rb`), the app's cask (`refract-app.rb`) and WinGet manifests (`refract-winget-manifests.tar.gz`). CLI smoke tests run on macOS, Linux and Windows before the release is published. Stable releases can update the Homebrew tap (the formula and the cask) automatically once its repository token is configured. [Packaging maintenance](packaging/README.md) describes the setup and manual publication steps. ## License diff --git a/packaging/README.md b/packaging/README.md index b4e1634..6134098 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -247,6 +247,17 @@ identity, notarizes it with the same API key, staples it and mounts it to check unsigned and uploaded as `Refract-dmg-adhoc-`. The window layout, the icon and the background are checked in (`macos/dmg/`, `macos/Resources/AppIcon.icns`); how to regenerate them is in `macos/README.md`, "Icon and disk image". +**Release (#71).** `release.yml` calls `macos-app.yml` with the tag, `require-signed: true` and +`tools-artifact: true` (the tool archives `tools.yml` built and smoke-tested in the same run), so a +missing secret or a failed signature or notarization fails the release instead of publishing an +ad hoc build. The release attaches `Refract-.dmg`, `Refract-.zip` and +`appcast-.xml` for arm64 and amd64, and refuses to publish without them (a prerelease has no +appcasts). `scripts/package-metadata.py` writes the cask `refract-app.rb` from the two disk images +(one per architecture, `arch arm:/intel:`, macOS 13 or later), next to the formula `refract.rb`, +and the `homebrew` job copies it to `Casks/refract-app.rb` in `ponytojas/homebrew-tap`. The cask's +`zap` removes only what the app can rebuild (caches, WebKit data, preferences, logs): never the +data folder or the Keychain item, and its caveat says so. + ## Server deployments Server deployments are a distinct path: `server/` (a systemd unit and @@ -266,7 +277,7 @@ package adds the Git dependency and desktop entry under the policy above. Prerel `scripts/package-metadata.py` uses Python 3.11+ and its standard library to verify the expected nested executable paths and calculate SHA-256 hashes from the actual -archives. It generates a macOS Homebrew formula and three WinGet manifests (version, +archives and the app's disk images. It generates a macOS Homebrew formula, the app's cask and three WinGet manifests (version, English locale and the x64/arm64 zip installers). They are release assets too: ```sh @@ -281,14 +292,17 @@ OAuth sign-in itself remains an interactive user step and is not exercised by CI ## Homebrew The tap is [ponytojas/homebrew-tap](https://github.com/ponytojas/homebrew-tap). -Copy the generated `homebrew/refract.rb` to `Formula/refract.rb` in that repository. -It uses the existing macOS binaries; neither Go nor Node is needed to install. +Copy the generated `homebrew/refract.rb` to `Formula/refract.rb` and `homebrew/refract-app.rb` +to `Casks/refract-app.rb` in that repository. The formula uses the existing macOS binaries; neither +Go nor Node is needed to install. The cask installs the signed disk image of the Mac's architecture. Validate on macOS before pushing the tap update: ```sh -ruby -c Formula/refract.rb +ruby -c Formula/refract.rb && ruby -c Casks/refract-app.rb +brew style Casks/refract-app.rb brew install ponytojas/tap/refract brew test ponytojas/tap/refract +brew install --cask ponytojas/tap/refract-app ``` For automatic updates after stable releases, configure these in the **Refract** @@ -301,7 +315,7 @@ repository's GitHub Actions settings: The default `GITHUB_TOKEN` cannot write to the separate tap. Without this setup, releases still publish packages and metadata, and the tap can be updated manually. -Prereleases never automatically update the stable formula. +Prereleases never automatically update the stable formula or cask. ## WinGet diff --git a/scripts/package-metadata.py b/scripts/package-metadata.py index 272f3cb..0157dc9 100644 --- a/scripts/package-metadata.py +++ b/scripts/package-metadata.py @@ -1,6 +1,9 @@ #!/usr/bin/env python3 """Generate Homebrew and WinGet metadata from the exact release archives. +Writes the CLI's formula (refract), the macOS app's cask (refract-app, from the +signed disk images Refract-.dmg) and the WinGet manifests. + Usage: python3 scripts/package-metadata.py v0.1.2 dist packaging-output Only the Python standard library is required. Run before publishing the release. """ @@ -41,6 +44,13 @@ def generate(tag: str, archives: Path, output: Path) -> None: with path.open("rb") as source: hashes[platform, arch] = hashlib.file_digest(source, "sha256").hexdigest() + # The app's disk images (macos-app.yml): both architectures, read before anything is written. + dmgs = {} + for arch in ("arm64", "amd64"): + path = archives / f"Refract-{arch}.dmg" + with path.open("rb") as source: + dmgs[arch] = hashlib.file_digest(source, "sha256").hexdigest() + formula = output / "homebrew" / "refract.rb" formula.parent.mkdir(parents=True, exist_ok=True) base = f"{REPO}/releases/download/{tag}" @@ -79,6 +89,44 @@ def caveats assert_match "-no-browser", shell_output("#{{bin}}/refract login --help 2>&1") end end +''', encoding="utf-8") + + # The app cask. Uninstalling, even with --zap, never removes the person's projects (the data + # folder, Application Support/Refract) or their key (Keychain): only what the app can rebuild. + cask = output / "homebrew" / "refract-app.rb" + cask.write_text(f'''cask "refract-app" do + arch arm: "arm64", intel: "amd64" + + version "{version}" + sha256 arm: "{dmgs['arm64']}", + intel: "{dmgs['amd64']}" + + url "{REPO}/releases/download/v#{{version}}/Refract-#{{arch}}.dmg" + name "Refract" + desc "LaTeX workspace with an AI assistant" + homepage "{REPO}" + + auto_updates true + depends_on macos: :ventura + + app "Refract.app" + + zap trash: [ + "~/Library/Caches/io.github.ponytojas.Refract", + "~/Library/HTTPStorages/io.github.ponytojas.Refract", + "~/Library/Logs/Refract", + "~/Library/Preferences/io.github.ponytojas.Refract.plist", + "~/Library/Saved Application State/io.github.ponytojas.Refract.savedState", + "~/Library/WebKit/io.github.ponytojas.Refract", + ] + + caveats <<~EOS + Uninstalling, even with --zap, keeps your projects in + ~/Library/Application Support/Refract + and Refract's key in the Keychain (item "Refract"). Delete them yourself + only if you no longer need those projects. + EOS +end ''', encoding="utf-8") winget = output / "winget" / "manifests" / "p" / "ponytojas" / "Refract" / version diff --git a/scripts/test_packaging.py b/scripts/test_packaging.py index 5428530..b14c6bf 100644 --- a/scripts/test_packaging.py +++ b/scripts/test_packaging.py @@ -50,6 +50,8 @@ def archives_for(self, tag): member.mode = 0o755 member.size = len(arch) archive.addfile(member, io.BytesIO(arch.encode())) + for arch in ("arm64", "amd64"): + (self.archives / f"Refract-{arch}.dmg").write_bytes(f"dmg-{arch}".encode()) def test_metadata_matches_release_archives(self): self.archives_for("v1.2.3") @@ -72,6 +74,38 @@ def test_metadata_matches_release_archives(self): if platform == "windows": self.assertIn(f"RelativeFilePath: refract-v1.2.3-windows-{arch}/refract.exe", installer) + def test_app_cask_matches_the_disk_images(self): + self.archives_for("v1.2.3") + generate("v1.2.3", self.archives, self.output) + cask = (self.output / "homebrew/refract-app.rb").read_text() + self.assertIn('cask "refract-app" do', cask) + self.assertIn('version "1.2.3"', cask) + self.assertIn("/releases/download/v#{version}/Refract-#{arch}.dmg", cask) + self.assertIn('app "Refract.app"', cask) + self.assertIn('depends_on macos: :ventura', cask) # LSMinimumSystemVersion 13.0 + self.assertIn("13.0", (ROOT / "macos/Resources/Info.plist").read_text()) + for arch, key in (("arm64", "arm"), ("amd64", "intel")): + checksum = hashlib.sha256((self.archives / f"Refract-{arch}.dmg").read_bytes()).hexdigest() + self.assertRegex(cask, rf'{key}:\s+"{checksum}"') + # The formula keeps the CLI's name; the app is a separate cask. + self.assertIn("class Refract < Formula", (self.output / "homebrew/refract.rb").read_text()) + + def test_app_cask_never_removes_projects_or_the_key(self): + self.archives_for("v1.2.3") + generate("v1.2.3", self.archives, self.output) + cask = (self.output / "homebrew/refract-app.rb").read_text() + zap = cask[cask.index("zap trash:"):cask.index("]", cask.index("zap trash:"))] + self.assertNotIn("Application Support", zap) + self.assertNotIn("Keychain", zap) + self.assertNotIn("uninstall", cask.split("zap trash:")[0]) + + def test_rejects_a_missing_disk_image_before_writing_metadata(self): + self.archives_for("v1.2.3") + (self.archives / "Refract-amd64.dmg").unlink() + with self.assertRaises(FileNotFoundError): + generate("v1.2.3", self.archives, self.output) + self.assertFalse(self.output.exists()) + def test_rejects_missing_nested_executable_before_writing_metadata(self): self.archives_for("v1.2.3") with zipfile.ZipFile(self.archives / "refract-v1.2.3-windows-arm64.zip", "w") as archive: @@ -579,6 +613,20 @@ def test_tools_workflow_builds_and_smokes_the_seed(self): self.assertIn(phrase, tools) self.assertIn("TEX_SEED_DIR", (ROOT / "scripts/build-tools.sh").read_text()) + def test_release_ships_the_signed_app_and_its_cask(self): + release = (ROOT / ".github/workflows/release.yml").read_text() + job = release[release.index("\n macos-app:\n"):release.index("\n cli-smoke:")] + self.assertIn("uses: ./.github/workflows/macos-app.yml", job) + self.assertIn("require-signed: true", job) + self.assertIn("tools-artifact: true", job) + self.assertIn("needs: tools", job) + for secret in ("MACOS_CERT_P12_BASE64", "MACOS_SIGN_IDENTITY", "NOTARY_KEY_P8_BASE64", "SPARKLE_ED_PRIVATE_KEY"): + self.assertIn(f"{secret}: ${{{{ secrets.{secret} }}}}", job) + self.assertRegex(release, r"release:\n needs: \[[^\]]*macos-app") + self.assertRegex(release, r"metadata:\n needs: \[[^\]]*macos-app") + self.assertIn('"Refract-$arch.dmg" "Refract-$arch.zip"', release) + self.assertIn("Casks/refract-app.rb", release) + def test_release_builds_and_gates_the_tool_archives(self): release = (ROOT / ".github/workflows/release.yml").read_text() self.assertIn("uses: ./.github/workflows/tools.yml", release) From 7626b6618d46052426c233f64134b143bb560695 Mon Sep 17 00:00:00 2001 From: Daniel Villalobos Date: Tue, 24 Nov 2026 19:23:36 +0100 Subject: [PATCH 2/3] Install the cask from the Use-Refract tap --- .github/workflows/release.yml | 4 ++-- CHANGELOG.md | 2 +- README.md | 6 +++--- packaging/README.md | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6b7b12..c09dc13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -231,7 +231,7 @@ jobs: gh release create "$GITHUB_REF_NAME" * --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" "$notes" $pre # The default token cannot write to a different repository. Opt in after - # adding a fine-grained HOMEBREW_TAP_TOKEN for ponytojas/homebrew-tap. + # adding a fine-grained HOMEBREW_TAP_TOKEN for Use-Refract/homebrew-tap. homebrew: needs: release if: vars.HOMEBREW_TAP_ENABLED == 'true' && !contains(github.ref_name, '-') @@ -243,7 +243,7 @@ jobs: path: metadata - uses: actions/checkout@v7 with: - repository: ponytojas/homebrew-tap + repository: Use-Refract/homebrew-tap token: ${{ secrets.HOMEBREW_TAP_TOKEN }} path: tap - name: Update tap diff --git a/CHANGELOG.md b/CHANGELOG.md index 3506714..58d6dd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Notable changes to Refract. The format follows [Keep a Changelog](https://keepac ### Added -- The macOS app is part of every release: a signed and notarized disk image per architecture (`Refract-arm64.dmg`, `Refract-amd64.dmg`) with its update feed, and a Homebrew cask (`brew install --cask ponytojas/tap/refract-app`). A release fails instead of publishing an app that isn't signed and notarized. Uninstalling the app, even with `--zap`, keeps your projects and key. +- The macOS app is part of every release: a signed and notarized disk image per architecture (`Refract-arm64.dmg`, `Refract-amd64.dmg`) with its update feed, and a Homebrew cask (`brew install --cask use-refract/tap/refract-app`). A release fails instead of publishing an app that isn't signed and notarized. Uninstalling the app, even with `--zap`, keeps your projects and key. - Refract can read its encryption key, OpenID Connect client secret, SMTP URL and OpenAlex API key from files using the corresponding `REFRACT_*_FILE` variables. `refract users` and `refract local` also accept the encryption key from a file, and the systemd unit starts Refract directly with a systemd credential. - `REFRACT_OUTBOUND` (`any` by default, or `public`) chooses whether AI provider base URLs and git remotes may reach loopback and private networks. `public` does what `REFRACT_MODE=saas` did for outbound requests, and checks at startup that git is 2.37 or later. With `public`, provider requests and redirects must be https, and link-local git remotes are refused in every mode. `REFRACT_MODE=saas` no longer changes it. - Refract finds `tectonic`, `synctex`, `rg` and `git` in a bundled `libexec/refract` folder next to the executable (the executable's own folder on Windows) before the `PATH`, and runs them by absolute path; a bundled Git uses only its own helpers and templates. `REFRACT_TECTONIC_BIN`, `REFRACT_SYNCTEX_BIN`, `REFRACT_RG_BIN` and `REFRACT_GIT_BIN` override the lookup. The startup log shows where each was found, and the web app shows one notice when a tool is missing, saying what won't work, on whichever page opens first. On macOS and Linux a bundled tool in a folder that others can write, or that another user owns, is ignored. The same checks cover bundled Git's helpers and templates. diff --git a/README.md b/README.md index 30f79fd..f1b62e1 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ Try Refract on your own computer in a few minutes: with the Mac app, the `refrac Download the disk image for your Mac from the [latest release](https://github.com/ponytojas/Refract/releases/latest): [Apple silicon](https://github.com/ponytojas/Refract/releases/latest/download/Refract-arm64.dmg) or [Intel](https://github.com/ponytojas/Refract/releases/latest/download/Refract-amd64.dmg) (**Apple menu → About This Mac** says which). Open it and drag **Refract** to **Applications**. Or with Homebrew: ```sh -brew install --cask ponytojas/tap/refract-app +brew install --cask use-refract/tap/refract-app ``` It needs macOS 13 or later and nothing else: Git, Tectonic, SyncTeX and ripgrep come inside the app, and the first PDF compiles offline. The app is signed and notarized, and updates itself (**Refract → Check for Updates…**). Your projects live in `~/Library/Application Support/Refract` and the key that protects stored passwords in the Keychain, outside the app: updating, or removing the app (even `brew uninstall --zap`), leaves them. Signing in to ChatGPT or adding an API key in **Settings → Assistant** is optional. The Homebrew formula `refract` is still the command line; the app is the cask `refract-app`. @@ -485,11 +485,11 @@ The CLI lets you run `refract login` on your computer and upload the resulting c **macOS (Apple Silicon or Intel):** ```sh -brew install ponytojas/tap/refract +brew install use-refract/tap/refract refract login ``` -Update with `brew update` followed by `brew upgrade ponytojas/tap/refract`. +Update with `brew update` followed by `brew upgrade use-refract/tap/refract`. **Debian / Ubuntu:** download the `.deb` for your architecture (`amd64` or `arm64`) from [Releases](https://github.com/ponytojas/Refract/releases). Packages are available starting with v0.1.2. For example, from the download directory: diff --git a/packaging/README.md b/packaging/README.md index 6134098..532b5a8 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -254,7 +254,7 @@ ad hoc build. The release attaches `Refract-.dmg`, `Refract-.zip` an `appcast-.xml` for arm64 and amd64, and refuses to publish without them (a prerelease has no appcasts). `scripts/package-metadata.py` writes the cask `refract-app.rb` from the two disk images (one per architecture, `arch arm:/intel:`, macOS 13 or later), next to the formula `refract.rb`, -and the `homebrew` job copies it to `Casks/refract-app.rb` in `ponytojas/homebrew-tap`. The cask's +and the `homebrew` job copies it to `Casks/refract-app.rb` in `Use-Refract/homebrew-tap`. The cask's `zap` removes only what the app can rebuild (caches, WebKit data, preferences, logs): never the data folder or the Keychain item, and its caveat says so. @@ -291,7 +291,7 @@ OAuth sign-in itself remains an interactive user step and is not exercised by CI ## Homebrew -The tap is [ponytojas/homebrew-tap](https://github.com/ponytojas/homebrew-tap). +The tap is [Use-Refract/homebrew-tap](https://github.com/Use-Refract/homebrew-tap). Copy the generated `homebrew/refract.rb` to `Formula/refract.rb` and `homebrew/refract-app.rb` to `Casks/refract-app.rb` in that repository. The formula uses the existing macOS binaries; neither Go nor Node is needed to install. The cask installs the signed disk image of the Mac's architecture. @@ -300,16 +300,16 @@ Validate on macOS before pushing the tap update: ```sh ruby -c Formula/refract.rb && ruby -c Casks/refract-app.rb brew style Casks/refract-app.rb -brew install ponytojas/tap/refract -brew test ponytojas/tap/refract -brew install --cask ponytojas/tap/refract-app +brew install use-refract/tap/refract +brew test use-refract/tap/refract +brew install --cask use-refract/tap/refract-app ``` For automatic updates after stable releases, configure these in the **Refract** repository's GitHub Actions settings: - Secret `HOMEBREW_TAP_TOKEN`: a fine-grained token restricted to - `ponytojas/homebrew-tap`, with **Contents: read and write**. Enter it directly + `Use-Refract/homebrew-tap`, with **Contents: read and write**. Enter it directly in GitHub's settings, not in a shell command or a committed file. - Variable `HOMEBREW_TAP_ENABLED`: `true`, after adding the secret. From f2fdcfeb6183c834b7ee7a4bb97801bc2bfcd7f3 Mon Sep 17 00:00:00 2001 From: Daniel Villalobos Date: Thu, 26 Nov 2026 14:44:28 +0100 Subject: [PATCH 3/3] Let the cask install on macOS 13 and later, link the Mac app downloads to Use-Refract and name the missing appcasts --- .github/workflows/release.yml | 2 +- README.md | 2 +- scripts/package-metadata.py | 2 +- scripts/test_packaging.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3de0b1..9872f73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -185,7 +185,7 @@ jobs: case "$GITHUB_REF_NAME" in *-*) echo "no appcasts in this prerelease"; exit 0 ;; esac - echo "::error::this release attaches the macOS app but no appcast-.xml: as the latest release it would break every installed app's update feed"; exit 1 + echo "::error::a full release must carry appcast-.xml: as the latest release it would break every installed app's update feed"; exit 1 fi for arch in arm64 amd64; do [ -f "dist/appcast-$arch.xml" ] || { echo "::error::appcast-$arch.xml is missing: an app of that architecture could never update"; exit 1; } diff --git a/README.md b/README.md index 251d0c0..bd70231 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Try Refract on your own computer in a few minutes: with the Mac app, the `refrac ### The Mac app -Download the disk image for your Mac from the [latest release](https://github.com/ponytojas/Refract/releases/latest): [Apple silicon](https://github.com/ponytojas/Refract/releases/latest/download/Refract-arm64.dmg) or [Intel](https://github.com/ponytojas/Refract/releases/latest/download/Refract-amd64.dmg) (**Apple menu → About This Mac** says which). Open it and drag **Refract** to **Applications**. Or with Homebrew: +Download the disk image for your Mac from the [latest release](https://github.com/Use-Refract/Refract/releases/latest): [Apple silicon](https://github.com/Use-Refract/Refract/releases/latest/download/Refract-arm64.dmg) or [Intel](https://github.com/Use-Refract/Refract/releases/latest/download/Refract-amd64.dmg) (**Apple menu → About This Mac** says which). Open it and drag **Refract** to **Applications**. Or with Homebrew: ```sh brew install --cask use-refract/tap/refract-app diff --git a/scripts/package-metadata.py b/scripts/package-metadata.py index fdcd2d9..fe06c3e 100644 --- a/scripts/package-metadata.py +++ b/scripts/package-metadata.py @@ -107,7 +107,7 @@ def caveats homepage "{REPO}" auto_updates true - depends_on macos: :ventura + depends_on macos: ">= :ventura" app "Refract.app" diff --git a/scripts/test_packaging.py b/scripts/test_packaging.py index b14c6bf..246fce4 100644 --- a/scripts/test_packaging.py +++ b/scripts/test_packaging.py @@ -82,7 +82,7 @@ def test_app_cask_matches_the_disk_images(self): self.assertIn('version "1.2.3"', cask) self.assertIn("/releases/download/v#{version}/Refract-#{arch}.dmg", cask) self.assertIn('app "Refract.app"', cask) - self.assertIn('depends_on macos: :ventura', cask) # LSMinimumSystemVersion 13.0 + self.assertIn('depends_on macos: ">= :ventura"', cask) # LSMinimumSystemVersion 13.0 self.assertIn("13.0", (ROOT / "macos/Resources/Info.plist").read_text()) for arch, key in (("arm64", "arm"), ("amd64", "intel")): checksum = hashlib.sha256((self.archives / f"Refract-{arch}.dmg").read_bytes()).hexdigest()