Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

feat(release): configure signed app distribution

Gener136fad29b9c9
diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml
index a62c3e958..aa3d58e97 100644
--- a/.github/workflows/desktop-release.yml
+++ b/.github/workflows/desktop-release.yml
@@ -82,18 +82,78 @@ jobs:
echo "::error::Release ${TAG} was not created within 60 seconds"
exit 1
+ - name: Prepare App Store Connect API key
+ if: runner.os == 'macOS'
+ shell: bash
+ env:
+ APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
+ APPLE_API_PRIVATE_KEY: ${{ secrets.APPLE_API_PRIVATE_KEY }}
+ run: |
+ test -n "$APPLE_API_KEY"
+ test -n "$APPLE_API_PRIVATE_KEY"
+ key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY}.p8"
+ umask 077
+ printf '%s' "$APPLE_API_PRIVATE_KEY" > "$key_path"
+ echo "APPLE_API_KEY_PATH=$key_path" >> "$GITHUB_ENV"
+
- name: Build Tauri app
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ APPLE_CERTIFICATE: ${{ runner.os == 'macOS' && secrets.APPLE_CERTIFICATE || '' }}
+ APPLE_CERTIFICATE_PASSWORD: ${{ runner.os == 'macOS' && secrets.APPLE_CERTIFICATE_PASSWORD || '' }}
+ APPLE_SIGNING_IDENTITY: ${{ runner.os == 'macOS' && secrets.APPLE_SIGNING_IDENTITY || '' }}
+ APPLE_API_ISSUER: ${{ runner.os == 'macOS' && secrets.APPLE_API_ISSUER || '' }}
+ APPLE_API_KEY: ${{ runner.os == 'macOS' && secrets.APPLE_API_KEY || '' }}
+ APPLE_API_KEY_PATH: ${{ env.APPLE_API_KEY_PATH }}
+ APPLE_TEAM_ID: ${{ runner.os == 'macOS' && secrets.APPLE_TEAM_ID || '' }}
with:
projectPath: src/desktop
releaseId: ${{ steps.release.outputs.id }}
uploadUpdaterJson: true
args: --target ${{ matrix.target }}
+ - name: Verify signed and notarized macOS artifact
+ if: runner.os == 'macOS'
+ shell: bash
+ env:
+ EXPECTED_TARGET: ${{ matrix.target }}
+ EXPECTED_VERSION: ${{ steps.version.outputs.version }}
+ run: |
+ set -euo pipefail
+ bundle_root="src/desktop/src-tauri/target/${EXPECTED_TARGET}/release/bundle"
+ dmg_path=$(find "$bundle_root/dmg" -maxdepth 1 -type f -name '*.dmg' -print -quit)
+ test -n "$dmg_path"
+
+ mount_dir=$(mktemp -d "$RUNNER_TEMP/alook-dmg.XXXXXX")
+ cleanup() {
+ hdiutil detach "$mount_dir" -quiet || true
+ rmdir "$mount_dir" || true
+ }
+ trap cleanup EXIT
+ hdiutil attach "$dmg_path" -nobrowse -readonly -mountpoint "$mount_dir" -quiet
+
+ app_path=$(find "$mount_dir" -maxdepth 1 -type d -name '*.app' -print -quit)
+ test -n "$app_path"
+ executable=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$app_path/Contents/Info.plist")
+ test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$app_path/Contents/Info.plist")" = "$EXPECTED_VERSION"
+
+ codesign --verify --deep --strict --verbose=2 "$app_path"
+ signature=$(codesign -dvvv "$app_path" 2>&1)
+ grep -q 'Authority=Developer ID Application:' <<<"$signature"
+ grep -q 'flags=.*runtime' <<<"$signature"
+ xcrun stapler validate "$app_path"
+ spctl --assess --type execute --verbose=4 "$app_path"
+
+ archs=$(lipo -archs "$app_path/Contents/MacOS/$executable")
+ case "$EXPECTED_TARGET" in
+ aarch64-apple-darwin) grep -qw arm64 <<<"$archs" ;;
+ x86_64-apple-darwin) grep -qw x86_64 <<<"$archs" ;;
+ *) exit 1 ;;
+ esac
+
update-release-notes:
needs: build
runs-on: ubuntu-latest
@@ -125,7 +185,7 @@ jobs:
### macOS
[Apple Silicon](${BASE}/Alook_${VERSION}_aarch64.dmg) | [Intel](${BASE}/Alook_${VERSION}_x64.dmg)
- These macOS builds are ad-hoc signed and are not notarized. On first launch, macOS may block the app; open System Settings → Privacy & Security and choose **Open Anyway**.
+ These macOS builds are Developer ID signed, hardened-runtime enabled, notarized by Apple, and validated for their advertised architecture.
### Windows
[.exe Installer](${BASE}/Alook_${VERSION}_x64-setup.exe) | [.msi](${BASE}/Alook_${VERSION}_x64_en-US.msi)
diff --git a/.github/workflows/mobile-release.yml b/.github/workflows/mobile-release.yml
new file mode 100644
index 000000000..a67839808
--- /dev/null
+++ b/.github/workflows/mobile-release.yml
@@ -0,0 +1,385 @@
+name: Mobile Release
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - "src/desktop/.deploy-version-mobile"
+ workflow_dispatch:
+ inputs:
+ upload:
+ description: Upload the signed IPA to App Store Connect for TestFlight processing
+ required: true
+ default: false
+ type: boolean
+
+concurrency:
+ group: mobile-release-${{ github.ref }}
+ cancel-in-progress: false
+
+jobs:
+ build-ios:
+ name: Build signed iOS IPA
+ runs-on: macos-latest
+ timeout-minutes: 45
+ permissions:
+ contents: read
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
+
+ - name: Setup Node.js
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
+ with:
+ node-version: 22
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+
+ - name: Install Rust stable
+ uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
+ with:
+ targets: aarch64-apple-ios,aarch64-apple-ios-sim
+
+ - name: Restore Rust cache
+ uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
+ with:
+ workspaces: src/desktop/src-tauri
+ key: ios-arm64
+
+ - name: Install frontend dependencies
+ run: pnpm install --frozen-lockfile
+ working-directory: src/desktop
+
+ - name: Verify automatic TestFlight release version
+ if: github.event_name == 'push'
+ shell: bash
+ run: |
+ set -euo pipefail
+ requested_version=$(tr -d '\n' < src/desktop/.deploy-version-mobile)
+ tauri_version=$(node -p "require('./src/desktop/src-tauri/tauri.conf.json').version")
+ package_version=$(node -p "require('./src/desktop/package.json').version")
+ test -n "$requested_version"
+ test "$requested_version" = "$tauri_version"
+ test "$requested_version" = "$package_version"
+
+ - name: Generate Xcode project
+ working-directory: src/desktop
+ env:
+ APPLE_DEVELOPMENT_TEAM: ${{ secrets.APPLE_TEAM_ID }}
+ run: pnpm tauri ios init --ci --skip-targets-install
+
+ - name: Build signed App Store Connect IPA
+ working-directory: src/desktop
+ env:
+ APPLE_DEVELOPMENT_TEAM: ${{ secrets.APPLE_TEAM_ID }}
+ IOS_CERTIFICATE: ${{ secrets.IOS_CERTIFICATE }}
+ IOS_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
+ IOS_MOBILE_PROVISION: ${{ secrets.IOS_MOBILE_PROVISION }}
+ run: |
+ set -euo pipefail
+ umask 077
+ certificate_path=$(mktemp "$RUNNER_TEMP/alook-ios-certificate.XXXXXX")
+ profile_source=$(mktemp "$RUNNER_TEMP/alook-ios-profile.XXXXXX")
+ profile_plist=$(mktemp "$RUNNER_TEMP/alook-ios-profile-plist.XXXXXX")
+ keychain_path="$RUNNER_TEMP/alook-ios-signing.keychain-db"
+ keychain_password=$(openssl rand -hex 24)
+
+ printf '%s' "$IOS_CERTIFICATE" | base64 --decode > "$certificate_path"
+ printf '%s' "$IOS_MOBILE_PROVISION" | base64 --decode > "$profile_source"
+ security cms -D -i "$profile_source" > "$profile_plist"
+ profile_uuid=$(/usr/libexec/PlistBuddy -c 'Print :UUID' "$profile_plist")
+
+ runner_user=$(id -un)
+ runner_home=$(dscl . -read "/Users/$runner_user" NFSHomeDirectory | awk '{print $2}')
+ case "$runner_home" in
+ /Users/*) ;;
+ *) echo "Unexpected runner home: $runner_home" >&2; exit 1 ;;
+ esac
+ profile_dir="$runner_home/Library/MobileDevice/Provisioning Profiles"
+ mkdir -p "$profile_dir"
+ install -m 600 "$profile_source" "$profile_dir/$profile_uuid.mobileprovision"
+
+ security create-keychain -p "$keychain_password" "$keychain_path"
+ security set-keychain-settings -lut 21600 "$keychain_path"
+ security unlock-keychain -p "$keychain_password" "$keychain_path"
+ security import "$certificate_path" \
+ -k "$keychain_path" \
+ -f pkcs12 \
+ -P "$IOS_CERTIFICATE_PASSWORD" \
+ -T /usr/bin/codesign \
+ -T /usr/bin/security
+ security set-key-partition-list \
+ -S apple-tool:,apple:,codesign: \
+ -s \
+ -k "$keychain_password" \
+ "$keychain_path"
+ security list-keychains -d user -s "$keychain_path"
+ security default-keychain -d user -s "$keychain_path"
+ security find-identity -v -p codesigning "$keychain_path" | grep -F 'Apple Distribution'
+
+ # Tauri 2.11.x can lose an imported distribution identity from its
+ # short-lived keychain on Xcode 26. Keep our verified keychain in the
+ # search list and let Tauri consume only the provisioning profile.
+ unset IOS_CERTIFICATE IOS_CERTIFICATE_PASSWORD
+ pnpm tauri ios build \
+ --export-method app-store-connect \
+ --config "{\"bundle\":{\"iOS\":{\"bundleVersion\":\"${GITHUB_RUN_NUMBER}\"}}}"
+
+ - name: Locate and verify IPA
+ id: ipa
+ shell: bash
+ run: |
+ set -euo pipefail
+ ipa_path=$(find src/desktop/src-tauri/gen/apple/build/arm64 -type f -name '*.ipa' -print -quit)
+ test -n "$ipa_path"
+ echo "path=$ipa_path" >> "$GITHUB_OUTPUT"
+
+ extract_dir=$(mktemp -d "$RUNNER_TEMP/alook-ipa.XXXXXX")
+ trap 'rm -rf "$extract_dir"' EXIT
+ unzip -q "$ipa_path" -d "$extract_dir"
+ app_path=$(find "$extract_dir/Payload" -maxdepth 1 -type d -name '*.app' -print -quit)
+ test -n "$app_path"
+
+ codesign --verify --deep --strict --verbose=2 "$app_path"
+ test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$app_path/Info.plist")" = "ai.alook.ios"
+ tauri_version=$(node -p "require('./src/desktop/src-tauri/tauri.conf.json').version")
+ package_version=$(node -p "require('./src/desktop/package.json').version")
+ test "$tauri_version" = "$package_version"
+ test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$app_path/Info.plist")" = "$tauri_version"
+ test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$app_path/Info.plist")" = "$GITHUB_RUN_NUMBER"
+
+ - name: Upload signed IPA artifact
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
+ with:
+ name: alook-ios-${{ github.run_id }}
+ path: ${{ steps.ipa.outputs.path }}
+ if-no-files-found: error
+ retention-days: 14
+
+ - name: Prepare App Store Connect API key
+ if: github.event_name == 'push' || inputs.upload == true
+ shell: bash
+ env:
+ APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
+ APPLE_API_PRIVATE_KEY: ${{ secrets.APPLE_API_PRIVATE_KEY }}
+ run: |
+ test -n "$APPLE_API_KEY"
+ test -n "$APPLE_API_PRIVATE_KEY"
+ key_dir="$RUNNER_TEMP/private_keys"
+ key_path="$key_dir/AuthKey_${APPLE_API_KEY}.p8"
+ umask 077
+ mkdir -p "$key_dir"
+ printf '%s' "$APPLE_API_PRIVATE_KEY" > "$key_path"
+ echo "API_PRIVATE_KEYS_DIR=$key_dir" >> "$GITHUB_ENV"
+
+ - name: Upload to App Store Connect
+ if: github.event_name == 'push' || inputs.upload == true
+ env:
+ APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
+ APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
+ run: |
+ xcrun altool --upload-app \
+ --file "${{ steps.ipa.outputs.path }}" \
+ --type ios \
+ --apiKey "$APPLE_API_KEY" \
+ --apiIssuer "$APPLE_API_ISSUER"
+
+ build-android:
+ name: Build signed Android APK
+ if: github.event_name == 'push'
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
+
+ - name: Setup Node.js
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
+ with:
+ node-version: 22
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+
+ - name: Setup Java
+ uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
+ with:
+ distribution: temurin
+ java-version: 17
+ cache: gradle
+
+ - name: Install Android SDK components
+ shell: bash
+ run: |
+ set -euo pipefail
+ sdkmanager="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
+ test -x "$sdkmanager"
+ "$sdkmanager" \
+ "platforms;android-36" \
+ "build-tools;36.0.0" \
+ "ndk;29.0.13846066"
+ echo "NDK_HOME=$ANDROID_HOME/ndk/29.0.13846066" >> "$GITHUB_ENV"
+
+ - name: Install Rust stable
+ uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
+ with:
+ targets: aarch64-linux-android,armv7-linux-androideabi
+
+ - name: Restore Rust cache
+ uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
+ with:
+ workspaces: src/desktop/src-tauri
+ key: android-universal
+
+ - name: Install frontend dependencies
+ run: pnpm install --frozen-lockfile
+ working-directory: src/desktop
+
+ - name: Generate Android project support files
+ working-directory: src/desktop
+ run: pnpm tauri android init --ci --skip-targets-install
+
+ - name: Read and verify mobile release version
+ id: version
+ shell: bash
+ run: |
+ set -euo pipefail
+ version=$(tr -d '\n' < src/desktop/.deploy-version-mobile)
+ tauri_version=$(node -p "require('./src/desktop/src-tauri/tauri.conf.json').version")
+ package_version=$(node -p "require('./src/desktop/package.json').version")
+ test -n "$version"
+ test "$version" = "$tauri_version"
+ test "$version" = "$package_version"
+ echo "value=$version" >> "$GITHUB_OUTPUT"
+
+ - name: Prepare Android release signing
+ shell: bash
+ env:
+ ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
+ ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
+ ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
+ ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
+ run: |
+ set -euo pipefail
+ test -n "$ANDROID_KEYSTORE"
+ test -n "$ANDROID_KEYSTORE_PASSWORD"
+ test -n "$ANDROID_KEY_ALIAS"
+ test -n "$ANDROID_KEY_PASSWORD"
+ keystore_path="$RUNNER_TEMP/alook-android-release.jks"
+ umask 077
+ printf '%s' "$ANDROID_KEYSTORE" | base64 --decode > "$keystore_path"
+ {
+ echo "SIGNING_STORE_FILE=$keystore_path"
+ echo "SIGNING_STORE_PASSWORD=$ANDROID_KEYSTORE_PASSWORD"
+ echo "SIGNING_KEY_ALIAS=$ANDROID_KEY_ALIAS"
+ echo "SIGNING_KEY_PASSWORD=$ANDROID_KEY_PASSWORD"
+ } >> "$GITHUB_ENV"
+
+ - name: Build signed universal APK
+ working-directory: src/desktop
+ run: |
+ set -euo pipefail
+ pnpm tauri android build \
+ --apk \
+ --ci \
+ --target aarch64 armv7 \
+ --config "{\"bundle\":{\"android\":{\"versionCode\":${GITHUB_RUN_NUMBER}}}}"
+
+ - name: Locate and verify APK
+ id: apk
+ shell: bash
+ env:
+ EXPECTED_VERSION: ${{ steps.version.outputs.value }}
+ run: |
+ set -euo pipefail
+ apk_source=$(find src/desktop/src-tauri/gen/android/app/build/outputs/apk -type f -name '*.apk' -print -quit)
+ test -n "$apk_source"
+
+ build_tools=$(find "$ANDROID_HOME/build-tools" -mindepth 1 -maxdepth 1 -type d -print | sort -V | tail -1)
+ aapt="$build_tools/aapt"
+ apksigner="$build_tools/apksigner"
+ test -x "$aapt"
+ test -x "$apksigner"
+
+ badging=$($aapt dump badging "$apk_source")
+ grep -F "package: name='ai.alook.android'" <<<"$badging"
+ grep -F "versionCode='${GITHUB_RUN_NUMBER}'" <<<"$badging"
+ grep -F "versionName='${EXPECTED_VERSION}'" <<<"$badging"
+
+ signature=$($apksigner verify --verbose --print-certs "$apk_source")
+ grep -F 'Verifies' <<<"$signature"
+ normalized_signature=$(tr '[:lower:]' '[:upper:]' <<<"$signature" | tr -d ':')
+ grep -F '9DC6EDE94BA663EEC9EC98FF7BAFD55E248B6C4BC2157FCF042DF59B0E410806' <<<"$normalized_signature"
+
+ apk_name="Alook_${EXPECTED_VERSION}_android.apk"
+ apk_path="$RUNNER_TEMP/$apk_name"
+ install -m 644 "$apk_source" "$apk_path"
+ echo "name=$apk_name" >> "$GITHUB_OUTPUT"
+ echo "path=$apk_path" >> "$GITHUB_OUTPUT"
+
+ - name: Upload signed APK artifact
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
+ with:
+ name: alook-android-${{ github.run_id }}
+ path: ${{ steps.apk.outputs.path }}
+ if-no-files-found: error
+ retention-days: 14
+
+ - name: Resolve GitHub release
+ id: release
+ shell: bash
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAG: v${{ steps.version.outputs.value }}
+ run: |
+ for attempt in {1..30}; do
+ if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ exit 0
+ fi
+ echo "Waiting for ${TAG} release (${attempt}/30)..."
+ sleep 2
+ done
+ echo "::error::Release ${TAG} was not created within 60 seconds"
+ exit 1
+
+ - name: Attach APK to GitHub release
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAG: v${{ steps.version.outputs.value }}
+ run: gh release upload "$TAG" "${{ steps.apk.outputs.path }}#${{ steps.apk.outputs.name }}" --repo "$GITHUB_REPOSITORY" --clobber
+
+ - name: Append Android download to release body
+ env:
+ APK_NAME: ${{ steps.apk.outputs.name }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAG: v${{ steps.version.outputs.value }}
+ run: |
+ notes_file="$RUNNER_TEMP/release-notes.md"
+ gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json body --jq '.body' > "$notes_file"
+
+ marker='<!-- alook-android-download -->'
+ if grep -Fq "$marker" "$notes_file"; then
+ echo "Android download section is already present on ${TAG}."
+ exit 0
+ fi
+
+ base="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}"
+ cat >> "$notes_file" <<EOF
+
+ ${marker}
+
+ ---
+
+ ## Android
+
+ [Download signed APK](${base}/${APK_NAME})
+
+ This universal APK supports 64-bit and 32-bit ARM Android devices. Install it manually after allowing installs from this source.
+ EOF
+
+ gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes-file "$notes_file"
diff --git a/scripts/bump-version.mjs b/scripts/bump-version.mjs
index 21a718c25..b57716f80 100644
--- a/scripts/bump-version.mjs
+++ b/scripts/bump-version.mjs
@@ -27,12 +27,14 @@ function bumpSemver(current, type) {
const args = process.argv.slice(2);
const updateMinCli = args.includes("--min-cli");
const includeDesktop = args.includes("--desktop");
+const includeMobile = args.includes("--mobile");
const unsupportedFlag = args.find(
- (arg) => arg.startsWith("--") && !["--min-cli", "--desktop"].includes(arg),
+ (arg) =>
+ arg.startsWith("--") &&
+ !["--min-cli", "--desktop", "--mobile"].includes(arg),
);
if (unsupportedFlag) {
console.error(`Unsupported flag: ${unsupportedFlag}`);
- console.error("Mobile releases are not configured; store signing accounts are required first.");
process.exit(1);
}
const filtered = args.filter((a) => !a.startsWith("--"));
@@ -42,6 +44,7 @@ if (!arg) {
console.error("Usage: pnpm bump <version|patch|minor|major> [flags]");
console.error(" pnpm bump patch");
console.error(" pnpm bump patch --desktop # trigger desktop build");
+ console.error(" pnpm bump patch --mobile # publish this version to TestFlight");
console.error(" pnpm bump patch --min-cli # also update MIN_CLI_VERSION");
process.exit(1);
}
@@ -90,6 +93,21 @@ writeFileSync(tauriConfPath, JSON.stringify(tauriConf, null, 2) + "\n");
files.push(tauriConfPath);
console.log(` tauri.conf.json: ${oldTauriVersion} → ${version}`);
+// Sync the generated iOS project's public version (always)
+const iosProjectPath = join(ROOT, "src/desktop/src-tauri/gen/apple/project.yml");
+let iosProject = readFileSync(iosProjectPath, "utf8");
+const oldIosVersionMatch = iosProject.match(/^\s*CFBundleShortVersionString:\s*(\S+)\s*$/m);
+if (!oldIosVersionMatch) {
+ throw new Error("CFBundleShortVersionString is missing from the generated iOS project");
+}
+iosProject = iosProject.replace(
+ /^(\s*CFBundleShortVersionString:\s*)\S+\s*$/m,
+ `$1${version}`,
+);
+writeFileSync(iosProjectPath, iosProject);
+files.push(iosProjectPath);
+console.log(` iOS CFBundleShortVersionString: ${oldIosVersionMatch[1]} → ${version}`);
+
// Sync Cargo.toml version (always)
const cargoTomlPath = join(ROOT, "src/desktop/src-tauri/Cargo.toml");
let cargoToml = readFileSync(cargoTomlPath, "utf8");
@@ -119,6 +137,14 @@ if (includeDesktop) {
console.log(` Desktop deploy trigger written`);
}
+// TestFlight deploy trigger (only with --mobile)
+if (includeMobile) {
+ const triggerPath = join(ROOT, "src/desktop/.deploy-version-mobile");
+ writeFileSync(triggerPath, version + "\n");
+ files.push(triggerPath);
+ console.log(` TestFlight deploy trigger written`);
+}
+
if (updateMinCli) {
const tomlPath = join(ROOT, "src/web/wrangler.toml");
let toml = readFileSync(tomlPath, "utf8");
@@ -141,4 +167,6 @@ console.log(` # CI will auto-tag and trigger:`);
console.log(` # - CF Workers deploy (always)`);
if (includeDesktop) console.log(` # - Desktop build (macOS/Linux/Windows)`);
if (!includeDesktop) console.log(` # - No desktop build (add --desktop to include)`);
+if (includeMobile) console.log(` # - Signed iOS build and automatic TestFlight upload`);
+if (!includeMobile) console.log(` # - No TestFlight upload (add --mobile to include)`);
console.log();
diff --git a/scripts/ci/native-shell-theme-colors.test.ts b/scripts/ci/native-shell-theme-colors.test.ts
index 7466e594b..789ebf0e9 100644
--- a/scripts/ci/native-shell-theme-colors.test.ts
+++ b/scripts/ci/native-shell-theme-colors.test.ts
@@ -19,7 +19,7 @@ const iosSplash = JSON.parse(
}>
}
const androidRuntime = readFileSync(
- resolve(desktopRoot, "gen/android/app/src/main/java/ai/alook/desktop/MainActivity.kt"),
+ resolve(desktopRoot, "gen/android/app/src/main/java/ai/alook/android/MainActivity.kt"),
"utf8",
)
const androidLightSplash = readFileSync(
diff --git a/scripts/ci/workflow-contract.test.ts b/scripts/ci/workflow-contract.test.ts
index 64377baf5..9594d733c 100644
--- a/scripts/ci/workflow-contract.test.ts
+++ b/scripts/ci/workflow-contract.test.ts
@@ -55,6 +55,8 @@ const autoTagReleaseWorkflow = normalizeWorkflow(
readFileSync(resolve(workflowRoot, "auto-tag-release.yml"), "utf8"),
)
const desktopReleaseWorkflow = normalizeWorkflow(readFileSync(resolve(workflowRoot, "desktop-release.yml"), "utf8"))
+const mobileReleaseWorkflowPath = resolve(workflowRoot, "mobile-release.yml")
+const mobileReleaseWorkflow = normalizeWorkflow(readFileSync(mobileReleaseWorkflowPath, "utf8"))
const desktopConfig = JSON.parse(
readFileSync(resolve(import.meta.dirname, "../../src/desktop/src-tauri/tauri.conf.json"), "utf8"),
) as {
@@ -85,7 +87,32 @@ const externalLinksCapability = JSON.parse(
) as ExternalLinksCapability
const desktopMacConfig = JSON.parse(
readFileSync(resolve(import.meta.dirname, "../../src/desktop/src-tauri/tauri.macos.conf.json"), "utf8"),
-) as { bundle?: { macOS?: { entitlements?: string; signingIdentity?: string } } }
+) as { bundle?: { macOS?: { entitlements?: string; hardenedRuntime?: boolean; signingIdentity?: string } } }
+const desktopIosConfig = JSON.parse(
+ readFileSync(resolve(import.meta.dirname, "../../src/desktop/src-tauri/tauri.ios.conf.json"), "utf8"),
+) as { identifier?: string }
+const desktopAndroidConfig = JSON.parse(
+ readFileSync(resolve(import.meta.dirname, "../../src/desktop/src-tauri/tauri.android.conf.json"), "utf8"),
+) as { identifier?: string }
+const androidGradle = readFileSync(
+ resolve(import.meta.dirname, "../../src/desktop/src-tauri/gen/android/app/build.gradle.kts"),
+ "utf8",
+)
+const androidMainActivity = readFileSync(
+ resolve(
+ import.meta.dirname,
+ "../../src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/android/MainActivity.kt",
+ ),
+ "utf8",
+)
+const iosExportOptions = readFileSync(
+ resolve(import.meta.dirname, "../../src/desktop/src-tauri/gen/apple/ExportOptions.plist"),
+ "utf8",
+)
+const iosProject = readFileSync(
+ resolve(import.meta.dirname, "../../src/desktop/src-tauri/gen/apple/project.yml"),
+ "utf8",
+)
const desktopEntitlementsPath = resolve(
import.meta.dirname,
"../../src/desktop/src-tauri/entitlements.plist",
@@ -121,7 +148,6 @@ const desktopDevConfig = JSON.parse(readFileSync(
app: { security: { capabilities: Array<string | DesktopCapability | ExternalLinksCapability> } }
}
const bumpScript = readFileSync(resolve(import.meta.dirname, "../bump-version.mjs"), "utf8")
-const mobileReleaseWorkflow = resolve(workflowRoot, "mobile-release.yml")
const desktopUpdateRoute = readFileSync(
resolve(import.meta.dirname, "../../src/web/src/app/api/desktop/update/[target]/[arch]/[current_version]/route.ts"),
"utf8",
@@ -802,16 +828,28 @@ describe("Desktop updater release", () => {
expect(desktopBuildScript).not.toContain(".bak")
})
- it("ad-hoc signs unnotarized macOS builds and discloses manual approval", () => {
+ it("keeps local ad-hoc signing while release builds use Developer ID notarization", () => {
expect(desktopMacConfig.bundle?.macOS?.signingIdentity).toBe("-")
+ expect(desktopMacConfig.bundle?.macOS?.hardenedRuntime).toBe(true)
expect(desktopMacConfig.bundle?.macOS?.entitlements).toBeUndefined()
expect(existsSync(desktopEntitlementsPath)).toBe(false)
- expect(desktopReleaseWorkflow).toContain("ad-hoc signed and are not notarized")
- expect(desktopReleaseWorkflow).toContain("Privacy & Security")
+ expect(desktopReleaseWorkflow).toContain("APPLE_CERTIFICATE:")
+ expect(desktopReleaseWorkflow).toContain("APPLE_CERTIFICATE_PASSWORD:")
+ expect(desktopReleaseWorkflow).toContain("APPLE_SIGNING_IDENTITY:")
+ expect(desktopReleaseWorkflow).toContain("APPLE_API_ISSUER:")
+ expect(desktopReleaseWorkflow).toContain("APPLE_API_KEY_PATH:")
+ expect(desktopReleaseWorkflow).toContain("codesign --verify --deep --strict")
+ expect(desktopReleaseWorkflow).toContain("flags=.*runtime")
+ expect(desktopReleaseWorkflow).toContain("xcrun stapler validate")
+ expect(desktopReleaseWorkflow).toContain("spctl --assess --type execute")
+ expect(desktopReleaseWorkflow).toContain("CFBundleShortVersionString")
+ expect(desktopReleaseWorkflow).toContain("EXPECTED_VERSION:")
+ expect(desktopReleaseWorkflow).toContain("Developer ID signed")
+ expect(desktopReleaseWorkflow).not.toContain("ad-hoc signed and are not notarized")
+ expect(desktopReleaseWorkflow).not.toContain("Privacy & Security")
expect(desktopReleaseWorkflow).toContain("not Authenticode code-signed")
expect(desktopReleaseWorkflow).toContain("More info")
expect(desktopReleaseWorkflow).toContain("Run anyway")
- expect(desktopReleaseWorkflow).not.toContain("APPLE_CERTIFICATE:")
})
})
@@ -849,9 +887,78 @@ describe("Desktop image clipboard", () => {
})
describe("Mobile release availability", () => {
- it("fails closed until store signing accounts and a current workflow exist", () => {
- expect(existsSync(mobileReleaseWorkflow)).toBe(false)
- expect(bumpScript).not.toContain("deploy-version-mobile")
- expect(bumpScript).toContain("Mobile releases are not configured")
+ it("publishes --mobile bumps to TestFlight and keeps manual uploads opt-in", () => {
+ expect(existsSync(mobileReleaseWorkflowPath)).toBe(true)
+ expect(desktopIosConfig.identifier).toBe("ai.alook.ios")
+ expect(iosProject).toContain("PRODUCT_BUNDLE_IDENTIFIER: ai.alook.ios")
+ expect(iosProject).not.toContain("PRODUCT_BUNDLE_IDENTIFIER: ai.alook.desktop")
+ expect(iosProject).toContain("CODE_SIGN_STYLE: Manual")
+ expect(iosProject).toContain("CODE_SIGN_IDENTITY: Apple Distribution")
+ expect(iosProject).toContain("PROVISIONING_PROFILE_SPECIFIER: Alook iOS App Store Connect")
+ expect(iosProject).not.toContain("${FORCE_COLOR}")
+ expect(iosExportOptions).toContain("<string>app-store-connect</string>")
+ expect(iosExportOptions).toContain("<string>manual</string>")
+ expect(iosExportOptions).toContain("<key>ai.alook.ios</key>")
+ expect(iosExportOptions).toContain("<string>Alook iOS App Store Connect</string>")
+ expect(mobileReleaseWorkflow).toMatch(/^ workflow_dispatch:/m)
+ expect(mobileReleaseWorkflow).toMatch(/^ push:/m)
+ expect(mobileReleaseWorkflow).toContain('branches: [main]')
+ expect(mobileReleaseWorkflow).toContain('src/desktop/.deploy-version-mobile')
+ expect(mobileReleaseWorkflow).not.toMatch(/^ pull_request:/m)
+ expect(mobileReleaseWorkflow).toContain("default: false")
+ expect(mobileReleaseWorkflow).toContain("github.event_name == 'push' || inputs.upload == true")
+ expect(mobileReleaseWorkflow).toContain("Verify automatic TestFlight release version")
+ expect(mobileReleaseWorkflow).toContain('requested_version=$(tr -d')
+ expect(mobileReleaseWorkflow).toContain("APPLE_DEVELOPMENT_TEAM:")
+ expect(mobileReleaseWorkflow).toContain("IOS_CERTIFICATE:")
+ expect(mobileReleaseWorkflow).toContain("IOS_CERTIFICATE_PASSWORD:")
+ expect(mobileReleaseWorkflow).toContain("IOS_MOBILE_PROVISION:")
+ expect(mobileReleaseWorkflow).toContain("pnpm tauri ios init --ci --skip-targets-install")
+ expect(mobileReleaseWorkflow).toContain('security import "$certificate_path"')
+ expect(mobileReleaseWorkflow).toContain('install -m 600 "$profile_source"')
+ expect(mobileReleaseWorkflow).toContain("unset IOS_CERTIFICATE IOS_CERTIFICATE_PASSWORD")
+ expect(mobileReleaseWorkflow).toContain("pnpm tauri ios build")
+ expect(mobileReleaseWorkflow).toContain("--export-method app-store-connect")
+ expect(mobileReleaseWorkflow).toContain('bundleVersion\\\":\\\"${GITHUB_RUN_NUMBER}')
+ expect(mobileReleaseWorkflow).toContain("CFBundleShortVersionString")
+ expect(mobileReleaseWorkflow).toContain("CFBundleVersion")
+ expect(mobileReleaseWorkflow).toContain("xcrun altool --upload-app")
+ expect(mobileReleaseWorkflow).toContain("actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a")
+ expect(bumpScript).toContain('args.includes("--mobile")')
+ expect(bumpScript).toContain("src/desktop/.deploy-version-mobile")
+ expect(bumpScript).toContain("automatic TestFlight upload")
+ expect(bumpScript).toContain("iOS CFBundleShortVersionString")
+ })
+
+ it("attaches a signed Android APK to --mobile GitHub releases without Google Play", () => {
+ expect(desktopAndroidConfig.identifier).toBe("ai.alook.android")
+ expect(androidGradle).toContain('namespace = "ai.alook.android"')
+ expect(androidGradle).toContain('applicationId = "ai.alook.android"')
+ expect(androidGradle).toContain('signingConfig = signingConfigs.getByName("release")')
+ expect(androidMainActivity).toContain("package ai.alook.android")
+ expect(mobileReleaseWorkflow).toContain("build-android:")
+ expect(mobileReleaseWorkflow).toContain("if: github.event_name == 'push'")
+ expect(mobileReleaseWorkflow).toContain("ANDROID_KEYSTORE:")
+ expect(mobileReleaseWorkflow).toContain("ANDROID_KEYSTORE_PASSWORD:")
+ expect(mobileReleaseWorkflow).toContain("ANDROID_KEY_ALIAS:")
+ expect(mobileReleaseWorkflow).toContain("ANDROID_KEY_PASSWORD:")
+ expect(mobileReleaseWorkflow).toContain("aarch64-linux-android,armv7-linux-androideabi")
+ expect(mobileReleaseWorkflow).toContain('"platforms;android-36"')
+ expect(mobileReleaseWorkflow).toContain('"build-tools;36.0.0"')
+ expect(mobileReleaseWorkflow).toContain('"ndk;29.0.13846066"')
+ expect(mobileReleaseWorkflow).toContain("pnpm tauri android init --ci --skip-targets-install")
+ expect(mobileReleaseWorkflow).toContain("pnpm tauri android build")
+ expect(mobileReleaseWorkflow).toContain("--target aarch64 armv7")
+ expect(mobileReleaseWorkflow).toContain("package: name='ai.alook.android'")
+ expect(mobileReleaseWorkflow).toContain("apksigner verify --verbose --print-certs")
+ expect(mobileReleaseWorkflow).toContain("gh release upload")
+ expect(mobileReleaseWorkflow).toContain("Alook_${EXPECTED_VERSION}_android.apk")
+ expect(mobileReleaseWorkflow).toContain('gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json body')
+ expect(mobileReleaseWorkflow).toContain('cat >> "$notes_file" <<EOF')
+ expect(mobileReleaseWorkflow).toContain('<!-- alook-android-download -->')
+ expect(mobileReleaseWorkflow).toContain("## Android")
+ expect(mobileReleaseWorkflow).toContain("[Download signed APK](${base}/${APK_NAME})")
+ expect(mobileReleaseWorkflow).toContain('gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes-file "$notes_file"')
+ expect(mobileReleaseWorkflow).not.toContain("Google Play")
})
})
diff --git a/src/desktop/src-tauri/gen/android/app/build.gradle.kts b/src/desktop/src-tauri/gen/android/app/build.gradle.kts
index ff336c6d9..537459791 100644
--- a/src/desktop/src-tauri/gen/android/app/build.gradle.kts
+++ b/src/desktop/src-tauri/gen/android/app/build.gradle.kts
@@ -15,10 +15,10 @@ val tauriProperties = Properties().apply {
android {
compileSdk = 36
- namespace = "ai.alook.desktop"
+ namespace = "ai.alook.android"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
- applicationId = "ai.alook.desktop"
+ applicationId = "ai.alook.android"
minSdk = 24
targetSdk = 36
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
@@ -89,4 +89,4 @@ dependencies {
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
-apply(from = "tauri.build.gradle.kts")
\ No newline at end of file
+apply(from = "tauri.build.gradle.kts")
diff --git a/src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/desktop/MainActivity.kt b/src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/android/MainActivity.kt
similarity index 99%
rename from src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/desktop/MainActivity.kt
rename to src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/android/MainActivity.kt
index c5641632e..410e4336f 100644
--- a/src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/desktop/MainActivity.kt
+++ b/src/desktop/src-tauri/gen/android/app/src/main/java/ai/alook/android/MainActivity.kt
@@ -1,4 +1,4 @@
-package ai.alook.desktop
+package ai.alook.android
import android.content.res.Configuration
import android.graphics.Color
diff --git a/src/desktop/src-tauri/gen/apple/ExportOptions.plist b/src/desktop/src-tauri/gen/apple/ExportOptions.plist
index 0428a171b..10b4e7e22 100644
--- a/src/desktop/src-tauri/gen/apple/ExportOptions.plist
+++ b/src/desktop/src-tauri/gen/apple/ExportOptions.plist
@@ -3,6 +3,17 @@
<plist version="1.0">
<dict>
<key>method</key>
- <string>debugging</string>
+ <string>app-store-connect</string>
+ <key>signingStyle</key>
+ <string>manual</string>
+ <key>signingCertificate</key>
+ <string>Apple Distribution</string>
+ <key>teamID</key>
+ <string>5RF24VHDQB</string>
+ <key>provisioningProfiles</key>
+ <dict>
+ <key>ai.alook.ios</key>
+ <string>Alook iOS App Store Connect</string>
+ </dict>
</dict>
</plist>
diff --git a/src/desktop/src-tauri/gen/apple/project.yml b/src/desktop/src-tauri/gen/apple/project.yml
index d49c5324e..93b547af4 100644
--- a/src/desktop/src-tauri/gen/apple/project.yml
+++ b/src/desktop/src-tauri/gen/apple/project.yml
@@ -1,6 +1,6 @@
name: alook-desktop
options:
- bundleIdPrefix: ai.alook.desktop
+ bundleIdPrefix: ai.alook.ios
deploymentTarget:
iOS: 14.0
fileGroups: [../../src]
@@ -11,7 +11,7 @@ settingGroups:
app:
base:
PRODUCT_NAME: Alook
- PRODUCT_BUNDLE_IDENTIFIER: ai.alook.desktop
+ PRODUCT_BUNDLE_IDENTIFIER: ai.alook.ios
targetTemplates:
app:
type: application
@@ -51,8 +51,8 @@ targets:
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
- CFBundleShortVersionString: 0.0.141
- CFBundleVersion: "0.0.141"
+ CFBundleShortVersionString: 0.1.31
+ CFBundleVersion: "1"
entitlements:
path: alook-desktop_iOS/alook-desktop_iOS.entitlements
scheme:
@@ -68,6 +68,12 @@ targets:
LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME) $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/$(PLATFORM_NAME)
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true
EXCLUDED_ARCHS[sdk=iphoneos*]: x86_64
+ configs:
+ release:
+ CODE_SIGN_STYLE: Manual
+ CODE_SIGN_IDENTITY: Apple Distribution
+ DEVELOPMENT_TEAM: 5RF24VHDQB
+ PROVISIONING_PROFILE_SPECIFIER: Alook iOS App Store Connect
groups: [app]
dependencies:
- framework: libapp.a
@@ -80,9 +86,9 @@ targets:
- sdk: UIKit.framework
- sdk: WebKit.framework
preBuildScripts:
- - script: pnpm tauri ios xcode-script -v --platform ${PLATFORM_DISPLAY_NAME:?} --sdk-root ${SDKROOT:?} --framework-search-paths "${FRAMEWORK_SEARCH_PATHS:?}" --header-search-paths "${HEADER_SEARCH_PATHS:?}" --gcc-preprocessor-definitions "${GCC_PREPROCESSOR_DEFINITIONS:-}" --configuration ${CONFIGURATION:?} ${FORCE_COLOR} ${ARCHS:?}
+ - script: pnpm tauri ios xcode-script -v --platform ${PLATFORM_DISPLAY_NAME:?} --sdk-root ${SDKROOT:?} --framework-search-paths "${FRAMEWORK_SEARCH_PATHS:?}" --header-search-paths "${HEADER_SEARCH_PATHS:?}" --gcc-preprocessor-definitions "${GCC_PREPROCESSOR_DEFINITIONS:-}" --configuration ${CONFIGURATION:?} ${ARCHS:?}
name: Build Rust Code
basedOnDependencyAnalysis: false
outputFiles:
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a
- - $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
\ No newline at end of file
+ - $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
diff --git a/src/desktop/src-tauri/tauri.android.conf.json b/src/desktop/src-tauri/tauri.android.conf.json
new file mode 100644
index 000000000..dbf81959b
--- /dev/null
+++ b/src/desktop/src-tauri/tauri.android.conf.json
@@ -0,0 +1,3 @@
+{
+ "identifier": "ai.alook.android"
+}
diff --git a/src/desktop/src-tauri/tauri.ios.conf.json b/src/desktop/src-tauri/tauri.ios.conf.json
new file mode 100644
index 000000000..3a07c2bb3
--- /dev/null
+++ b/src/desktop/src-tauri/tauri.ios.conf.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "./gen/schemas/ios-schema.json",
+ "identifier": "ai.alook.ios"
+}
diff --git a/src/desktop/src-tauri/tauri.macos.conf.json b/src/desktop/src-tauri/tauri.macos.conf.json
index 9635c7ab8..060e61c87 100644
--- a/src/desktop/src-tauri/tauri.macos.conf.json
+++ b/src/desktop/src-tauri/tauri.macos.conf.json
@@ -5,7 +5,8 @@
"targets": ["app", "dmg"],
"macOS": {
"minimumSystemVersion": "11.0",
- "signingIdentity": "-"
+ "signingIdentity": "-",
+ "hardenedRuntime": true
}
}
}