Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 46 additions & 7 deletions .github/workflows/desktop-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
- "apps/presentation/dashboard/**"
- "examples/desktop-icon-alpha-smoke.py"
- "examples/desktop-release-workflow-smoke.py"
- "scripts/desktop_macos_signing.py"
- "scripts/desktop_release_artifacts.py"
- "tests/desktop/test_desktop_signing_workflow.py"
release:
types: [published]
workflow_dispatch:
Expand Down Expand Up @@ -75,6 +77,19 @@ jobs:
fi
echo "release-tag=${release_tag}" >> "${GITHUB_OUTPUT}"

- name: Resolve macOS signing mode
id: macos-signing
if: github.event_name != 'pull_request' && runner.os == 'macOS'
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: python3 scripts/desktop_macos_signing.py resolve-mode

- name: Set up Node
uses: actions/setup-node@v6
with:
Expand Down Expand Up @@ -125,20 +140,42 @@ jobs:
working-directory: apps/desktop/loopx-control-plane
run: npm run build -- --bundles ${{ matrix.bundles }} --no-sign

- name: Build integrity-signed macOS release bundles
- name: Build macOS release bundles
if: github.event_name != 'pull_request' && runner.os == 'macOS'
working-directory: apps/desktop/loopx-control-plane
env:
RELEASE_TAG: ${{ steps.identity.outputs.release-tag }}
EXPECTED_SIGNING_MODE: ${{ steps.macos-signing.outputs.signing-mode }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
set -euo pipefail
release_version="${RELEASE_TAG#v}"
if [[ ! "${release_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.-]+)?$ ]]; then
echo "::error title=Invalid desktop release version::${RELEASE_TAG} is not a supported release tag"
exit 1
fi
npm run build -- --bundles ${{ matrix.bundles }} \
--config "{\"version\":\"${release_version}\",\"bundle\":{\"macOS\":{\"signingIdentity\":\"-\"}}}"
python3 ../../../scripts/desktop_macos_signing.py build \
--version "${release_version}" \
--bundles ${{ matrix.bundles }} \
--expected-mode "${EXPECTED_SIGNING_MODE}"

- name: Notarize macOS disk image
if: github.event_name != 'pull_request' && runner.os == 'macOS' && steps.macos-signing.outputs.signing-mode == 'developer_id'
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
set -euo pipefail
dmg_path="$(find apps/desktop/loopx-control-plane/src-tauri/target/release/bundle/dmg -maxdepth 1 -name '*.dmg' -print -quit)"
test -n "${dmg_path}"
python3 scripts/desktop_macos_signing.py notarize-dmg --dmg "${dmg_path}"

- name: Build Windows release bundles
if: github.event_name != 'pull_request' && runner.os == 'Windows'
Expand All @@ -159,15 +196,17 @@ jobs:
- name: Verify macOS desktop bundles
if: github.event_name != 'pull_request' && runner.os == 'macOS'
shell: bash
env:
SIGNING_MODE: ${{ steps.macos-signing.outputs.signing-mode }}
run: |
set -euo pipefail
app_path="apps/desktop/loopx-control-plane/src-tauri/target/release/bundle/macos/LoopX.app"
dmg_path="$(find apps/desktop/loopx-control-plane/src-tauri/target/release/bundle/dmg -maxdepth 1 -name '*.dmg' -print -quit)"
test -n "${dmg_path}"
codesign --verify --deep --strict --verbose=2 "${app_path}"
codesign --display --verbose=4 "${app_path}" 2>&1 \
| grep -q '^Signature=adhoc$'
hdiutil verify "${dmg_path}"
python3 scripts/desktop_macos_signing.py verify \
--signing-mode "${SIGNING_MODE}" \
--app "${app_path}" \
--dmg "${dmg_path}"

- name: Collect macOS desktop bundles
if: runner.os == 'macOS'
Expand Down
40 changes: 39 additions & 1 deletion .github/workflows/desktop-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- 'apps/desktop/**'
- 'scripts/desktop_*'
- 'tests/desktop/**'
- '.github/workflows/desktop-updater.yml'
release:
types: [published]
Expand Down Expand Up @@ -107,6 +108,17 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Resolve macOS signing mode
id: macos-signing
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: python3 scripts/desktop_macos_signing.py resolve-mode
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -120,12 +132,38 @@ jobs:
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
EXPECTED_SIGNING_MODE: ${{ steps.macos-signing.outputs.signing-mode }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
VERSION: ${{ needs.identity.outputs.version }}
BUNDLE: app
run: |
set -euo pipefail
test -n "$TAURI_SIGNING_PRIVATE_KEY"
npm run build -- --bundles "$BUNDLE" --config "{\"version\":\"$VERSION\",\"bundle\":{\"createUpdaterArtifacts\":true,\"macOS\":{\"signingIdentity\":\"-\"}}}"
python3 ../../../scripts/desktop_macos_signing.py build \
--version "$VERSION" \
--bundles "$BUNDLE" \
--create-updater-artifacts \
--expected-mode "$EXPECTED_SIGNING_MODE"
- name: Verify macOS updater bundle
if: runner.os == 'macOS'
shell: bash
env:
SIGNING_MODE: ${{ steps.macos-signing.outputs.signing-mode }}
run: |
set -euo pipefail
app_path="apps/desktop/loopx-control-plane/src-tauri/target/release/bundle/macos/LoopX.app"
updater_tar_gz="$(find apps/desktop/loopx-control-plane/src-tauri/target/release/bundle -type f -name '*.app.tar.gz' -print -quit)"
test -n "${updater_tar_gz}"
python3 scripts/desktop_macos_signing.py verify \
--signing-mode "${SIGNING_MODE}" \
--app "${app_path}" \
--updater-tar-gz "${updater_tar_gz}"
- name: Collect native updater artifacts
shell: bash
env:
Expand Down
62 changes: 51 additions & 11 deletions apps/desktop/loopx-control-plane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,13 @@ serves your terminal runtime) checks that host's installation. It cannot
diagnose this Mac App's local bootstrap; only the App's own diagnostics do.

The updater accepts only fixed official HTTPS channels, not browser-provided
commands, paths or download URLs. Its signing private key is confined to the
release secret; the App embeds the public key. PR validation has no signing
secret. Updater signing does not provide Apple notarization. It also does not
change Goal authority, grant capabilities, or stop running agents on behalf of
the user. Services may briefly disconnect during reconciliation.
commands, paths or download URLs. Its minisign private key
(`TAURI_SIGNING_PRIVATE_KEY`) is confined to the release secret; the App embeds
the public key. PR validation has no signing secret and keeps `--no-sign`
preview builds. Updater minisign signing is distinct from Apple Developer ID
signing and notarization; it also does not change Goal authority, grant
capabilities, or stop running agents on behalf of the user. Services may
briefly disconnect during reconciliation.

The background feed check has a thirty-second deadline and is outside local
workspace startup. A manual **Check for updates** allows 45 seconds for the same
Expand All @@ -513,10 +515,45 @@ A timeout remains an explicit retryable error, never a claim that the App is
current. Archive downloads use the separate connection, idle-read and total
deadlines described above. Installation and recovery boundaries are unchanged.

Published macOS preview artifacts use ad-hoc code signing to verify bundle
integrity without requiring an Apple Developer account. They are not signed
with a Developer ID and are not notarized, so macOS may require the operator
to approve the first launch in System Settings > Privacy & Security.
On non-PR official macOS builds (`desktop-release-artifacts.yml` and
`desktop-updater.yml`), signing and notarization depend on the five core Apple
secrets (`APPLE_CERTIFICATE`, `APPLE_CERTIFICATE_PASSWORD`, `APPLE_ID`,
`APPLE_PASSWORD`, `APPLE_TEAM_ID`; plus optional `KEYCHAIN_PASSWORD`, which
defaults to an ephemeral random password per build if unset, and optional
`APPLE_SIGNING_IDENTITY`):

- **Developer ID + Apple Notarization (all 5 core secrets set):** Tauri signs
`LoopX.app` with Developer ID Application and Hardened Runtime, notarizes and
staples `LoopX.app` before zipping `LoopX.app.zip` or packing the updater's
`.app.tar.gz`, and the release workflow notarizes and staples the `.dmg` with
`xcrun notarytool` / `xcrun stapler`. Both `.app` and `.dmg` are verified with
`codesign --verify --deep --strict`, `Authority=Developer ID Application:`,
`spctl --assess`, `xcrun stapler validate`, and `hdiutil verify`.
- **Ad-hoc integrity signing (all 5 core secrets unset):** Non-PR builds keep
`"signingIdentity": "-"` (`Signature=adhoc` verified via
`codesign --verify --deep --strict` and `hdiutil verify`). Partial
configurations (1–4 of 5 core secrets) fail closed instead of downgrading.
- **Updater signature compatibility across transitions:** `src-tauri` verifies
updater archives with the embedded minisign key and validates both staged
candidates and rollback backups with `codesign --verify --deep --strict`
(`installed_bundle_verifies` / `replace_bundle`), with no ad-hoc-only check.
Existing ad-hoc installations can upgrade in-app to Developer ID + notarized
releases (and between Developer ID releases) through the normal updater flow.

When running an ad-hoc-signed or unsigned preview build on macOS Sequoia 15+,
Gatekeeper's initial dialog offers **Move to Trash** by default instead of an
inline **Open Anyway** button. Do not click **Move to Trash**; approve the first
launch using either option below:

1. Click **Done** to dismiss the Gatekeeper dialog, open **System Settings →
Privacy & Security**, scroll to the Security section, click **Open Anyway**
next to the `LoopX` prompt, and confirm launch.
2. Or, after verifying the download against `DESKTOP-SHA256SUMS`, clear the
quarantine attribute in Terminal:

```bash
xattr -dr com.apple.quarantine /Applications/LoopX.app
```

## Runtime Model

Expand Down Expand Up @@ -824,8 +861,11 @@ comparison; they do not certify an installed update or an executing task's recov
`src-tauri/target/release/bundle/`. The release workflow builds macOS `.dmg`
and `.app.zip` artifacts on macOS, Windows `.msi` and `.exe` artifacts on
Windows, and uploads them to the GitHub Release that triggered the workflow.
It verifies the ad-hoc macOS app signature and disk-image integrity before
upload. A separate `DESKTOP-SHA256SUMS` manifest covers all desktop artifacts
When the Apple signing and notarization secrets are configured, it verifies
Developer ID signing, Gatekeeper assessment (`spctl`), stapled notarization
tickets (`xcrun stapler validate`), and disk-image integrity before upload;
when all five core Apple secrets are unset, it verifies the ad-hoc macOS app
signature and disk-image integrity instead. A separate `DESKTOP-SHA256SUMS` manifest covers all desktop artifacts
attached by the workflow, and release builds use the Git tag as the desktop
bundle version. A manual rerun for an existing tag is an explicit full desktop
republish: it rebuilds both macOS and Windows assets, preserves the previous
Expand Down
Loading
Loading