From 014d2ec8ae4f015f0548ba0306cc56c0c06f36d4 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Thu, 30 Jul 2026 17:45:29 +0200 Subject: [PATCH] fix(ios): publish AltStore/SideStore source manifests from the repo root --- .changeset/fix-altstore-source-manifests.md | 5 ++ .github/scripts/update-altstore-source.mjs | 4 +- .github/workflows/tauri-build.yml | 78 ++++++++++++++++++--- README.md | 8 +-- altstore-source-nightly.json | 32 +++++++++ altstore-source.json | 4 +- 6 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 .changeset/fix-altstore-source-manifests.md create mode 100644 altstore-source-nightly.json diff --git a/.changeset/fix-altstore-source-manifests.md b/.changeset/fix-altstore-source-manifests.md new file mode 100644 index 000000000..a068a532a --- /dev/null +++ b/.changeset/fix-altstore-source-manifests.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix AltStore/SideStore iOS sources: the source manifests (`altstore-source.json` for stable, `altstore-source-nightly.json` for nightly) are now committed at the repository root with their full version history on every release, and can be added via their raw GitHub URLs. diff --git a/.github/scripts/update-altstore-source.mjs b/.github/scripts/update-altstore-source.mjs index a254d9c84..770c8e75e 100644 --- a/.github/scripts/update-altstore-source.mjs +++ b/.github/scripts/update-altstore-source.mjs @@ -54,9 +54,9 @@ const entry = { localizedDescription: description ?? `v${version}`, }; -// Replace an existing entry for this version, otherwise prepend as latest. +// Replace the existing entry for this version, otherwise prepend as latest. const versions = Array.isArray(app.versions) ? app.versions : []; -const idx = versions.findIndex((v) => v.version === version); +const idx = versions.findIndex((v) => v.version === normalizedVersion); if (idx >= 0) versions[idx] = entry; else versions.unshift(entry); diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index fac99cb0f..d230208d7 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -502,26 +502,88 @@ jobs: STEPS_IPA_OUTPUTS_PATH: ${{ steps.ipa.outputs.path }} run: gh release upload "$TAG" "${STEPS_IPA_OUTPUTS_PATH}" --clobber + - name: Generate bot token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + permission-contents: write + + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${STEPS_APP_TOKEN_OUTPUTS_APP_SLUG}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + STEPS_APP_TOKEN_OUTPUTS_APP_SLUG: ${{ steps.app-token.outputs.app-slug }} + + - name: Configure bot git identity + run: | + git config --global user.name '${STEPS_APP_TOKEN_OUTPUTS_APP_SLUG}[bot]' + git config --global user.email '${STEPS_GET_USER_ID_OUTPUTS_USER_ID}+${STEPS_APP_TOKEN_OUTPUTS_APP_SLUG}[bot]@users.noreply.github.com' + gh auth setup-git + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + STEPS_APP_TOKEN_OUTPUTS_APP_SLUG: ${{ steps.app-token.outputs.app-slug }} + STEPS_GET_USER_ID_OUTPUTS_USER_ID: ${{ steps.get-user-id.outputs.user-id }} + - name: Update AltStore/SideStore source shell: bash env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} REPO: ${{ github.repository }} + NIGHTLY: ${{ needs.setup-release.outputs.nightly }} ALTSTORE_VERSION: ${{ steps.ipa.outputs.ipa_version }} ALTSTORE_VERSION_BUILD: ${{ steps.ipa.outputs.ipa_build }} STEPS_IPA_OUTPUTS_NAME: ${{ steps.ipa.outputs.name }} STEPS_IPA_OUTPUTS_SIZE: ${{ steps.ipa.outputs.size }} run: | + set -euo pipefail + if [ "$NIGHTLY" = "true" ]; then + SOURCE_FILE="altstore-source-nightly.json" + else + SOURCE_FILE="altstore-source.json" + fi DOWNLOAD_URL="https://github.com/$REPO/releases/download/$TAG/${STEPS_IPA_OUTPUTS_NAME}" DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" - if gh release download "$TAG" --pattern 'altstore-source.json' --dir . --clobber 2>/dev/null; then - echo "Using existing altstore-source.json from release $TAG" - else - echo "Using repo altstore-source.json" + WT="$RUNNER_TEMP/altstore-source" + + # Commit the updated manifest to the repo root on dev so version + # history persists; [skip ci] avoids retriggering builds. + UPDATED=0 + for attempt in 1 2 3; do + git fetch origin dev + git worktree remove --force "$WT" 2>/dev/null || true + git worktree add --detach "$WT" origin/dev + node "$GITHUB_WORKSPACE/.github/scripts/update-altstore-source.mjs" \ + "$WT/$SOURCE_FILE" "${ALTSTORE_VERSION:-$VERSION}" "${ALTSTORE_VERSION_BUILD:-$VERSION}" "${STEPS_IPA_OUTPUTS_SIZE}" "$DOWNLOAD_URL" "$DATE" "Sable $VERSION" + git -C "$WT" add "$SOURCE_FILE" + if git -C "$WT" diff --cached --quiet; then + echo "$SOURCE_FILE already up to date on dev" + UPDATED=1 + break + fi + git -C "$WT" commit -m "chore: update $SOURCE_FILE for $TAG [skip ci]" + if git -C "$WT" push origin HEAD:dev; then + UPDATED=1 + break + fi + echo "Push to dev failed (attempt $attempt); retrying from latest dev tip" + done + if [ "$UPDATED" != "1" ]; then + git worktree remove --force "$WT" 2>/dev/null || true + echo "Failed to commit $SOURCE_FILE to dev" >&2 + exit 1 fi - node .github/scripts/update-altstore-source.mjs \ - altstore-source.json "${ALTSTORE_VERSION:-$VERSION}" "${ALTSTORE_VERSION_BUILD:-$VERSION}" "${STEPS_IPA_OUTPUTS_SIZE}" "$DOWNLOAD_URL" "$DATE" "Sable $VERSION" - gh release upload "$TAG" altstore-source.json --clobber + + # Keep the release asset in sync for users on the release-asset source URLs. + gh release upload "$TAG" "$WT/$SOURCE_FILE" --clobber + if [ "$NIGHTLY" = "true" ]; then + # Existing nightly sources point at releases/download/nightly/altstore-source.json. + cp "$WT/$SOURCE_FILE" "$RUNNER_TEMP/altstore-source.json" + gh release upload "$TAG" "$RUNNER_TEMP/altstore-source.json" --clobber + fi + git worktree remove --force "$WT" 2>/dev/null || true updater-manifest: name: Publish updater manifest diff --git a/README.md b/README.md index 57e39c72d..787f27bee 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,10 @@ Sable iOS builds are distributed as unsigned IPAs through [AltStore](https://alt 1. Set up [AltStore Classic](https://faq.altstore.io/altstore-classic/altserver) or [SideStore](https://docs.sidestore.io) on your device. 2. Add the Sable source (tap a button above), or add it manually: - - AltStore (stable): `altstore://source?url=https://github.com/SableClient/Sable/releases/latest/download/altstore-source.json` - - SideStore (stable): `sidestore://source?url=https://github.com/SableClient/Sable/releases/latest/download/altstore-source.json` - - AltStore (nightly): `altstore://source?url=https://github.com/SableClient/Sable/releases/download/nightly/altstore-source.json` - - SideStore (nightly): `sidestore://source?url=https://github.com/SableClient/Sable/releases/download/nightly/altstore-source.json` + - AltStore (stable): `altstore://source?url=https://raw.githubusercontent.com/SableClient/Sable/dev/altstore-source.json` + - SideStore (stable): `sidestore://source?url=https://raw.githubusercontent.com/SableClient/Sable/dev/altstore-source.json` + - AltStore (nightly): `altstore://source?url=https://raw.githubusercontent.com/SableClient/Sable/dev/altstore-source-nightly.json` + - SideStore (nightly): `sidestore://source?url=https://raw.githubusercontent.com/SableClient/Sable/dev/altstore-source-nightly.json` 3. Install Sable from the source. The IPA is unsigned; AltStore/SideStore re-sign it with your personal development certificate at install time, so apps refresh every 7 days (the standard free-account limitation). iOS builds are produced by the `ios` job in [`tauri-build.yml`](.github/workflows/tauri-build.yml) and track the same `dev`/`v*` triggers as desktop builds. diff --git a/altstore-source-nightly.json b/altstore-source-nightly.json new file mode 100644 index 000000000..9a159046a --- /dev/null +++ b/altstore-source-nightly.json @@ -0,0 +1,32 @@ +{ + "name": "Sable (nightly)", + "identifier": "moe.sable.client.source.nightly", + "subtitle": "Sable for iOS (nightly)", + "description": "Sable iOS nightly builds for AltStore and SideStore, rebuilt on every push to dev.", + "iconURL": "https://raw.githubusercontent.com/SableClient/Sable/dev/src-tauri/icons/icon.png", + "website": "https://github.com/SableClient/Sable", + "tintColor": "#5CA399", + "featuredApps": ["moe.sable.client"], + "apps": [ + { + "name": "Sable", + "bundleIdentifier": "moe.sable.client", + "developerName": "SableClient", + "subtitle": "Sable iOS (nightly)", + "localizedDescription": "Sable for iOS. Nightly builds from dev; unsigned, resigned at install by AltStore/SideStore.", + "iconURL": "https://raw.githubusercontent.com/SableClient/Sable/dev/src-tauri/icons/icon.png", + "tintColor": "#5CA399", + "category": "social", + "screenshots": [], + "versions": [], + "appPermissions": { + "entitlements": ["aps-environment"], + "privacy": { + "NSCameraUsageDescription": "Sable needs camera access for video calls.", + "NSMicrophoneUsageDescription": "Sable needs microphone access for voice and video calls." + } + } + } + ], + "news": [] +} diff --git a/altstore-source.json b/altstore-source.json index c6eef4691..e8c7178b0 100644 --- a/altstore-source.json +++ b/altstore-source.json @@ -12,8 +12,8 @@ "name": "Sable", "bundleIdentifier": "moe.sable.client", "developerName": "SableClient", - "subtitle": "Sable iOS (nightly)", - "localizedDescription": "Sable for iOS. Nightly builds from dev; unsigned, resigned at install by AltStore/SideStore.", + "subtitle": "Sable iOS", + "localizedDescription": "Sable for iOS. Unsigned builds, resigned at install by AltStore/SideStore.", "iconURL": "https://raw.githubusercontent.com/SableClient/Sable/dev/src-tauri/icons/icon.png", "tintColor": "#5CA399", "category": "social",