Repository navigation
ci(release): take a tagged main commit to TestFlight, with the store text ready to paste #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d057b11
ci(release): upload a tagged main commit to TestFlight
GeiserX 799e6f8
docs(app-store): store text in English and Spanish and the review not…
GeiserX f8c84a4
test: hold the store text, icon and release settings to their rules
GeiserX 1ea61fa
docs: README with the pitch, features, quick start and docs
GeiserX c504080
docs(design): record the new disclosure and the store subtitle
GeiserX 6e62b0f
test: accept a subtitle of exactly 30 characters, App Store Connect's…
GeiserX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| name: Release to TestFlight | ||
|
|
||
| # Push a tag vX.Y.Z that matches MARKETING_VERSION in project.yml, on a commit of main whose CI passed. | ||
| # Each upload needs a CURRENT_PROJECT_VERSION higher than the last one App Store Connect received. | ||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| concurrency: | ||
| group: release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| testflight: | ||
| name: Archive and upload | ||
| runs-on: macos-latest | ||
| timeout-minutes: 60 | ||
| env: | ||
| TEAM_ID: 624WUVM8B4 | ||
| BUNDLE_ID: io.github.geiserx.tgarchive | ||
| APP_PROFILE_NAME: TG Archive App Store | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check the tag is on main and CI passed there | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| git fetch --no-tags origin main | ||
| if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then | ||
| echo "::error::$GITHUB_REF_NAME points at $GITHUB_SHA, which is not on main" | ||
| exit 1 | ||
| fi | ||
| conclusion=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow ci.yml --branch main \ | ||
| --commit "$GITHUB_SHA" --json conclusion --jq '.[0].conclusion // "none"') | ||
| if [ "$conclusion" != success ]; then | ||
| echo "::error::CI on main for $GITHUB_SHA is '$conclusion', not success" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Check the tag matches project.yml | ||
| run: | | ||
| VERSION=$(awk '/^ *MARKETING_VERSION:/ {print $2; exit}' project.yml) | ||
| if [ "v$VERSION" != "$GITHUB_REF_NAME" ]; then | ||
| echo "::error::Tag $GITHUB_REF_NAME does not match MARKETING_VERSION $VERSION in project.yml" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Check the signing secrets exist | ||
| env: | ||
| APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }} | ||
| APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }} | ||
| APPSTORE_PRIVATE_KEY: ${{ secrets.APPSTORE_PRIVATE_KEY }} | ||
| DIST_CERTIFICATE_P12: ${{ secrets.DIST_CERTIFICATE_P12 }} | ||
| DIST_CERTIFICATE_PASSWORD: ${{ secrets.DIST_CERTIFICATE_PASSWORD }} | ||
| PROFILE_APP: ${{ secrets.PROFILE_APP }} | ||
| run: | | ||
| missing=0 | ||
| for name in APPSTORE_ISSUER_ID APPSTORE_KEY_ID APPSTORE_PRIVATE_KEY DIST_CERTIFICATE_P12 \ | ||
| DIST_CERTIFICATE_PASSWORD PROFILE_APP; do | ||
| if [ -z "${!name}" ]; then echo "::error::Secret $name is not set"; missing=1; fi | ||
| done | ||
| exit $missing | ||
|
|
||
| - name: Install the distribution certificate | ||
| env: | ||
| DIST_CERTIFICATE_P12: ${{ secrets.DIST_CERTIFICATE_P12 }} | ||
| DIST_CERTIFICATE_PASSWORD: ${{ secrets.DIST_CERTIFICATE_PASSWORD }} | ||
| run: | | ||
| KEYCHAIN="$RUNNER_TEMP/signing.keychain-db" | ||
| KEYCHAIN_PASSWORD=$(openssl rand -hex 24) | ||
| security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN" | ||
| security set-keychain-settings -lut 3600 "$KEYCHAIN" | ||
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN" | ||
| printf '%s' "$DIST_CERTIFICATE_P12" | base64 --decode > "$RUNNER_TEMP/dist.p12" | ||
| security import "$RUNNER_TEMP/dist.p12" -k "$KEYCHAIN" -P "$DIST_CERTIFICATE_PASSWORD" \ | ||
| -T /usr/bin/codesign -T /usr/bin/security | ||
| rm -f "$RUNNER_TEMP/dist.p12" | ||
| security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN" > /dev/null | ||
| # Put the new keychain first and keep the existing ones searchable (one path per word). | ||
| existing=$(security list-keychains -d user | tr -d '"' | xargs) | ||
| # shellcheck disable=SC2086 | ||
| security list-keychains -d user -s "$KEYCHAIN" $existing | ||
| security find-identity -v -p codesigning "$KEYCHAIN" | ||
|
|
||
| - name: Install the provisioning profile | ||
| env: | ||
| PROFILE_APP: ${{ secrets.PROFILE_APP }} | ||
| run: | | ||
| printf '%s' "$PROFILE_APP" | base64 --decode > "$RUNNER_TEMP/profile.mobileprovision" | ||
| security cms -D -i "$RUNNER_TEMP/profile.mobileprovision" > "$RUNNER_TEMP/profile.plist" | ||
| name=$(plutil -extract Name raw "$RUNNER_TEMP/profile.plist") | ||
| if [ "$name" != "$APP_PROFILE_NAME" ]; then | ||
| echo "::error::PROFILE_APP is the profile '$name', not '$APP_PROFILE_NAME'" | ||
| exit 1 | ||
| fi | ||
| uuid=$(plutil -extract UUID raw "$RUNNER_TEMP/profile.plist") | ||
| for dir in "$HOME/Library/MobileDevice/Provisioning Profiles" \ | ||
| "$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles"; do | ||
| mkdir -p "$dir" | ||
| cp "$RUNNER_TEMP/profile.mobileprovision" "$dir/$uuid.mobileprovision" | ||
| done | ||
| rm -f "$RUNNER_TEMP/profile.mobileprovision" "$RUNNER_TEMP/profile.plist" | ||
|
|
||
| - name: Install XcodeGen and generate the project | ||
| run: | | ||
| brew install xcodegen | ||
| xcodegen generate | ||
|
|
||
| - name: Archive | ||
| run: | | ||
| set -o pipefail | ||
| xcodebuild archive \ | ||
| -project TGArchive.xcodeproj -scheme TGArchive -configuration Release \ | ||
| -destination "generic/platform=iOS" \ | ||
| -archivePath "$RUNNER_TEMP/TGArchive.xcarchive" \ | ||
| | grep -E "error:|warning: .*\.swift|\*\* ARCHIVE" | ||
|
|
||
| - name: Export the IPA | ||
| run: | | ||
| cat > "$RUNNER_TEMP/ExportOptions.plist" <<PLIST | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>method</key><string>app-store-connect</string> | ||
| <key>destination</key><string>export</string> | ||
| <key>teamID</key><string>${TEAM_ID}</string> | ||
| <key>signingStyle</key><string>manual</string> | ||
| <key>signingCertificate</key><string>Apple Distribution</string> | ||
| <key>provisioningProfiles</key> | ||
| <dict> | ||
| <key>${BUNDLE_ID}</key><string>${APP_PROFILE_NAME}</string> | ||
| </dict> | ||
| <key>uploadSymbols</key><true/> | ||
| </dict> | ||
| </plist> | ||
| PLIST | ||
| xcodebuild -exportArchive \ | ||
| -archivePath "$RUNNER_TEMP/TGArchive.xcarchive" \ | ||
| -exportOptionsPlist "$RUNNER_TEMP/ExportOptions.plist" \ | ||
| -exportPath "$RUNNER_TEMP/export" | ||
| ls -la "$RUNNER_TEMP/export" | ||
|
|
||
| - name: Upload to TestFlight | ||
| env: | ||
| APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }} | ||
| APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }} | ||
| APPSTORE_PRIVATE_KEY: ${{ secrets.APPSTORE_PRIVATE_KEY }} | ||
| run: | | ||
| mkdir -p "$HOME/.appstoreconnect/private_keys" | ||
| KEY="$HOME/.appstoreconnect/private_keys/AuthKey_${APPSTORE_KEY_ID}.p8" | ||
| printf '%s\n' "$APPSTORE_PRIVATE_KEY" > "$KEY" | ||
| chmod 600 "$KEY" | ||
| xcrun altool --upload-app -t ios -f "$RUNNER_TEMP/export/TGArchive.ipa" \ | ||
| --apiKey "$APPSTORE_KEY_ID" --apiIssuer "$APPSTORE_ISSUER_ID" | ||
|
|
||
| - name: Remove signing material | ||
| if: always() | ||
| run: | | ||
| security delete-keychain "$RUNNER_TEMP/signing.keychain-db" 2>/dev/null || true | ||
| rm -rf "$HOME/.appstoreconnect/private_keys" | ||
| rm -f "$HOME/Library/MobileDevice/Provisioning Profiles/"*.mobileprovision | ||
| rm -f "$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles/"*.mobileprovision | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.