Skip to content

A local-first personal finance app

[AI] Submit App Store releases automatically and move TestFlight uploads to nightly (#9330)

Matiss Janis Aboltinsbd2b08240df6
diff --git a/.github/actions/app-store-connect-publish/action.yml b/.github/actions/app-store-connect-publish/action.yml
new file mode 100644
index 0000000000..83ebfbe294
--- /dev/null
+++ b/.github/actions/app-store-connect-publish/action.yml
@@ -0,0 +1,51 @@
+name: Publish to App Store Connect
+description: Uploads a signed .ipa or .pkg, releases it to the external TestFlight group and optionally submits it for App Store review
+
+inputs:
+ path:
+ description: Glob of the .ipa or .pkg to upload
+ required: true
+ platform:
+ description: IOS or MAC_OS
+ required: true
+ submit-for-review:
+ description: Also submit the build for App Store review, releasing it after approval
+ required: false
+ default: 'false'
+ key-id:
+ description: App Store Connect API key ID
+ required: true
+ issuer-id:
+ description: App Store Connect API issuer ID
+ required: true
+ private-key:
+ description: App Store Connect API private key (.p8 contents)
+ required: true
+
+runs:
+ using: composite
+ steps:
+ - name: Upload
+ shell: bash
+ env:
+ APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ inputs.key-id }}
+ APP_STORE_CONNECT_ISSUER_ID: ${{ inputs.issuer-id }}
+ APP_STORE_CONNECT_PRIVATE_KEY: ${{ inputs.private-key }}
+ ARTIFACT_PATH: ${{ inputs.path }}
+ PLATFORM: ${{ inputs.platform }}
+ SUBMIT_FOR_REVIEW: ${{ inputs.submit-for-review }}
+ run: |
+ EXTRA_ARGS=()
+ if [ "$SUBMIT_FOR_REVIEW" = 'true' ]; then
+ EXTRA_ARGS=(--app-store --release-type AFTER_APPROVAL)
+ fi
+ # Every build goes to the external "Beta testers" TestFlight group, which
+ # needs Beta App Review; the previous build still waiting in that review
+ # is expired so nightlies do not pile up. Apple can take a while to list
+ # and then process a build before it can be submitted.
+ pipx run --spec codemagic-cli-tools==0.70.0 app-store-connect publish \
+ --path "$ARTIFACT_PATH" --platform "$PLATFORM" \
+ --max-find-build-wait 45 --max-build-processing-wait 45 \
+ --testflight --beta-group 'Beta testers' --expire-build-submitted-for-review \
+ --whats-new 'Full release notes: https://actualbudget.org/docs/releases' \
+ "${EXTRA_ARGS[@]}"
diff --git a/.github/workflows/publish-ios.yml b/.github/workflows/publish-ios.yml
index 81eefe3b85..8ae76b9b26 100644
--- a/.github/workflows/publish-ios.yml
+++ b/.github/workflows/publish-ios.yml
@@ -1,8 +1,8 @@
name: Publish iOS
-# Uploads the Capacitor iOS app to App Store Connect. Every master push
-# produces a TestFlight build; a published release produces the build that
-# a human then submits for App Store review from App Store Connect.
+# Uploads the Capacitor iOS app to App Store Connect. The nightly run
+# produces a TestFlight build from master for the external "Beta testers"
+# group; a published release also submits the build for App Store review.
#
# Secrets (all in the `release` environment) and how to regenerate them:
#
@@ -24,20 +24,9 @@ name: Publish iOS
# (downloadable only once) is the P8 secret's full contents.
on:
- push:
- branches:
- - master
- paths-ignore:
- # Packages that are not part of the mobile app bundle.
- - 'packages/api/**'
- - 'packages/ci-actions/**'
- - 'packages/cli/**'
- - 'packages/desktop-electron/**'
- - 'packages/docs/**'
- - 'packages/eslint-plugin-actual/**'
- - 'packages/sync-server/**'
- - 'upcoming-release-notes/**'
- - '**.md'
+ # Nightly TestFlight build from master.
+ schedule:
+ - cron: '0 1 * * *'
release:
types: [published]
# Pick the branch or tag to build from the "Use workflow from" selector.
@@ -46,7 +35,7 @@ on:
concurrency:
group: publish-ios
# Queue every run instead of replacing a pending one, so a release build is
- # never dropped because a master push arrived right after it.
+ # never dropped because a nightly run arrived right after it.
queue: max
cancel-in-progress: false
@@ -57,7 +46,8 @@ jobs:
publish-ios:
runs-on: depot-macos-latest
environment: release
- timeout-minutes: 60
+ # Includes up to 45 minutes waiting for Apple to process the build.
+ timeout-minutes: 90
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
@@ -101,30 +91,40 @@ jobs:
printf '%s\n' "$API_KEY_P8" > "$RUNNER_TEMP/AuthKey.p8"
chmod 600 "$RUNNER_TEMP/AuthKey.p8"
- - name: Archive and upload to App Store Connect
+ - name: Archive and export the signed app
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
run: |
export XCODEBUILD_AUTH_ARGS="-authenticationKeyPath $RUNNER_TEMP/AuthKey.p8 -authenticationKeyID $API_KEY_ID -authenticationKeyIssuerID $API_ISSUER_ID"
- yarn workspace mobile-client release:ios
+ yarn workspace mobile-client build:ipa
- - name: Summarize uploaded build
+ - name: Clean up signing material
+ if: always()
+ run: |
+ security delete-keychain "$RUNNER_TEMP/publish-ios.keychain-db" 2>/dev/null || true
+ rm -f "$RUNNER_TEMP/AuthKey.p8" "$RUNNER_TEMP/signing.p12"
+
+ - name: Summarize build
run: |
PLIST=packages/mobile-client/build/App.xcarchive/Products/Applications/App.app/Info.plist
VERSION="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$PLIST")"
BUILD="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$PLIST")"
{
- echo "## iOS build uploaded to App Store Connect"
+ echo "## iOS build"
echo
echo "| Version | Build |"
echo "| --- | --- |"
echo "| $VERSION | $BUILD |"
} >> "$GITHUB_STEP_SUMMARY"
- - name: Clean up signing material
- if: always()
- run: |
- security delete-keychain "$RUNNER_TEMP/publish-ios.keychain-db" 2>/dev/null || true
- rm -f "$RUNNER_TEMP/AuthKey.p8" "$RUNNER_TEMP/signing.p12"
+ - name: Upload to App Store Connect
+ uses: ./.github/actions/app-store-connect-publish
+ with:
+ path: packages/mobile-client/build/export/*.ipa
+ platform: IOS
+ submit-for-review: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
+ key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
+ issuer-id: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
+ private-key: ${{ secrets.APP_STORE_CONNECT_API_KEY_P8 }}
diff --git a/.github/workflows/publish-mac-app-store.yml b/.github/workflows/publish-mac-app-store.yml
index 83a8daf8a1..e5e34d9421 100644
--- a/.github/workflows/publish-mac-app-store.yml
+++ b/.github/workflows/publish-mac-app-store.yml
@@ -1,8 +1,8 @@
name: Publish Mac App Store
-# Uploads the sandboxed Electron app to App Store Connect. Every master push
-# produces a TestFlight build; a published release produces the build that
-# a human then submits for App Store review from App Store Connect.
+# Uploads the sandboxed Electron app to App Store Connect. The nightly run
+# produces a TestFlight build from master for the external "Beta testers"
+# group; a published release also submits the build for App Store review.
#
# Secrets (all in the `release` environment) and how to regenerate them:
#
@@ -25,19 +25,9 @@ name: Publish Mac App Store
# with the iOS workflow.
on:
- push:
- branches:
- - master
- paths-ignore:
- # Packages that are not part of the desktop app bundle.
- - 'packages/api/**'
- - 'packages/ci-actions/**'
- - 'packages/cli/**'
- - 'packages/docs/**'
- - 'packages/eslint-plugin-actual/**'
- - 'packages/mobile-client/**'
- - 'upcoming-release-notes/**'
- - '**.md'
+ # Nightly TestFlight build from master.
+ schedule:
+ - cron: '0 1 * * *'
release:
types: [published]
# Pick the branch or tag to build from the "Use workflow from" selector.
@@ -46,7 +36,7 @@ on:
concurrency:
group: publish-mac-app-store
# Queue every run instead of replacing a pending one, so a release build is
- # never dropped because a master push arrived right after it.
+ # never dropped because a nightly run arrived right after it.
queue: max
cancel-in-progress: false
@@ -57,7 +47,8 @@ jobs:
publish-mac-app-store:
runs-on: depot-macos-latest
environment: release
- timeout-minutes: 60
+ # Includes up to 45 minutes waiting for Apple to process the build.
+ timeout-minutes: 90
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
@@ -80,44 +71,43 @@ jobs:
- name: Build web app and Electron sources
run: ./bin/package-electron --skip-translations --skip-exe-build
- - name: Write provisioning profile and App Store Connect API key
+ - name: Write provisioning profile
env:
PROFILE_BASE64: ${{ secrets.APPLE_MAS_PROVISIONING_PROFILE_BASE64 }}
- API_KEY_P8: ${{ secrets.APP_STORE_CONNECT_API_KEY_P8 }}
- API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
- run: |
- echo "$PROFILE_BASE64" | base64 --decode > packages/desktop-electron/mas/embedded.provisionprofile
- mkdir -p "$RUNNER_TEMP/private_keys"
- printf '%s\n' "$API_KEY_P8" > "$RUNNER_TEMP/private_keys/AuthKey_$API_KEY_ID.p8"
- chmod 600 "$RUNNER_TEMP/private_keys/AuthKey_$API_KEY_ID.p8"
+ run: echo "$PROFILE_BASE64" | base64 --decode > packages/desktop-electron/mas/embedded.provisionprofile
- - name: Package, sign and upload to App Store Connect
+ - name: Package and sign
env:
# electron-builder imports both certificates into a temporary keychain.
CSC_LINK: ${{ secrets.APPLE_SIGNING_P12_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_SIGNING_P12_PASSWORD }}
CSC_INSTALLER_LINK: ${{ secrets.APPLE_MAS_INSTALLER_P12_BASE64 }}
CSC_INSTALLER_KEY_PASSWORD: ${{ secrets.APPLE_MAS_INSTALLER_P12_PASSWORD }}
- APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
- APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
- API_PRIVATE_KEYS_DIR: ${{ runner.temp }}/private_keys
- run: yarn workspace desktop-electron release:mas
+ run: yarn workspace desktop-electron build:mas
+
+ - name: Clean up signing material
+ if: always()
+ run: rm -f packages/desktop-electron/mas/embedded.provisionprofile
- - name: Summarize uploaded build
+ - name: Summarize build
run: |
PLIST=packages/desktop-electron/dist/mas-arm64/Actual.app/Contents/Info.plist
VERSION="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$PLIST")"
BUILD="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$PLIST")"
{
- echo "## Mac App Store build uploaded to App Store Connect"
+ echo "## Mac App Store build"
echo
echo "| Version | Build |"
echo "| --- | --- |"
echo "| $VERSION | $BUILD |"
} >> "$GITHUB_STEP_SUMMARY"
- - name: Clean up signing material
- if: always()
- run: |
- rm -rf "$RUNNER_TEMP/private_keys"
- rm -f packages/desktop-electron/mas/embedded.provisionprofile
+ - name: Upload to App Store Connect
+ uses: ./.github/actions/app-store-connect-publish
+ with:
+ path: packages/desktop-electron/dist/mas-arm64/*.pkg
+ platform: MAC_OS
+ submit-for-review: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
+ key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
+ issuer-id: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
+ private-key: ${{ secrets.APP_STORE_CONNECT_API_KEY_P8 }}
diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json
index 64f9c44b69..61f9c05216 100644
--- a/packages/desktop-electron/package.json
+++ b/packages/desktop-electron/package.json
@@ -15,8 +15,7 @@
"watch": "yarn build:dist && cross-env ACTUAL_DOCUMENT_DIR=\"../../data\" ACTUAL_DATA_DIR=\"../../data\" electron .",
"e2e": "npx playwright test",
"build:mas": "electron-builder --mac mas --arm64 --config.mac.bundleVersion=\"$(date -u +%Y%m%d%H%M)\"",
- "build:mas-dev": "electron-builder --mac mas-dev --arm64",
- "release:mas": "yarn build:mas && xcrun altool --upload-app -f dist/mas-arm64/Actual-mac-app-store-arm64.pkg --type macos --apiKey \"$APP_STORE_CONNECT_API_KEY_ID\" --apiIssuer \"$APP_STORE_CONNECT_API_ISSUER_ID\""
+ "build:mas-dev": "electron-builder --mac mas-dev --arm64"
},
"dependencies": {
"@actual-app/sync-server": "workspace:*",
diff --git a/packages/docs/docs/faq.md b/packages/docs/docs/faq.md
index 8c34e5efaf..e72ce1696a 100644
--- a/packages/docs/docs/faq.md
+++ b/packages/docs/docs/faq.md
@@ -2,7 +2,7 @@
- **Q.** _Can I use the mobile apps with my self hosted version of Actual?_
- **A.** The official mobile applications are deprecated. However, Actual's web version is a responsive Progressive Web App that you can install to your home screen and use like a native app. Additionally, the community also maintains unofficial native clients. See [Community Projects](community-repos.md) for available options.
+ **A.** Yes. An official iOS app is in beta testing and connects to your own server. You can [join the beta on TestFlight](https://testflight.apple.com/join/Sk6BEyBQ) to try it; beta testers get a new build every night with the latest changes from the development branch, so expect the occasional rough edge. There is no official Android app yet. On any device, Actual's web version is a responsive Progressive Web App that you can install to your home screen and use like a native app. Additionally, the community also maintains unofficial native clients. See [Community Projects](community-repos.md) for available options.
- **Q.** _Can I sync my bank to Actual automatically?_
diff --git a/packages/mobile-client/ios/App/ExportOptions.plist b/packages/mobile-client/ios/App/ExportOptions.plist
index ac65a7b106..1b10ed67c7 100644
--- a/packages/mobile-client/ios/App/ExportOptions.plist
+++ b/packages/mobile-client/ios/App/ExportOptions.plist
@@ -4,11 +4,7 @@
<dict>
<key>method</key>
<string>app-store-connect</string>
- <key>destination</key>
- <string>upload</string>
<key>signingStyle</key>
<string>automatic</string>
- <key>uploadSymbols</key>
- <true/>
</dict>
</plist>
diff --git a/packages/mobile-client/package.json b/packages/mobile-client/package.json
index a022466a05..a22eed973d 100644
--- a/packages/mobile-client/package.json
+++ b/packages/mobile-client/package.json
@@ -11,7 +11,7 @@
"sync:android": "yarn stage:www && cap sync android",
"build:ios": "yarn sync:ios && xcodebuild -workspace ios/App/App.xcworkspace -scheme App -archivePath ./build/App.xcarchive archive CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO",
"build:android": "yarn sync:android && cd android/ && ./gradlew assembleDebug && cp ./app/build/outputs/apk/debug/app-debug.apk ../build/",
- "release:ios": "NODE_ENV=production yarn sync:ios && xcodebuild -workspace ios/App/App.xcworkspace -scheme App -configuration Release -destination generic/platform=iOS -archivePath build/App.xcarchive -allowProvisioningUpdates ${XCODEBUILD_AUTH_ARGS:-} DEVELOPMENT_TEAM=\"$APPLE_TEAM_ID\" MARKETING_VERSION=\"$npm_package_version\" CURRENT_PROJECT_VERSION=\"$(date -u +%Y%m%d%H%M)\" archive && xcodebuild -exportArchive -archivePath build/App.xcarchive -exportOptionsPlist ios/App/ExportOptions.plist -exportPath build/export -allowProvisioningUpdates ${XCODEBUILD_AUTH_ARGS:-}",
+ "build:ipa": "NODE_ENV=production yarn sync:ios && xcodebuild -workspace ios/App/App.xcworkspace -scheme App -configuration Release -destination generic/platform=iOS -archivePath build/App.xcarchive -allowProvisioningUpdates ${XCODEBUILD_AUTH_ARGS:-} DEVELOPMENT_TEAM=\"$APPLE_TEAM_ID\" MARKETING_VERSION=\"$npm_package_version\" CURRENT_PROJECT_VERSION=\"$(date -u +%Y%m%d%H%M)\" archive && xcodebuild -exportArchive -archivePath build/App.xcarchive -exportOptionsPlist ios/App/ExportOptions.plist -exportPath build/export -allowProvisioningUpdates ${XCODEBUILD_AUTH_ARGS:-}",
"release:android": "yarn sync:android && cap build android",
"build": "yarn build:ios && yarn build:android",
"start:ios": "yarn build:ios && cap run ios --live-reload --port 3001",
diff --git a/upcoming-release-notes/submit-app-store-releases-automatically.md b/upcoming-release-notes/submit-app-store-releases-automatically.md
new file mode 100644
index 0000000000..70226d4b3d
--- /dev/null
+++ b/upcoming-release-notes/submit-app-store-releases-automatically.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MatissJanis]
+---
+
+Submit the iOS and Mac App Store builds for review automatically on each release, and send nightly TestFlight builds to the external beta testers group instead of uploading on every merge