TestFlight #12
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
| name: TestFlight | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| changelog: | |
| description: "What's new in this beta build" | |
| required: false | |
| default: "Automated build from CI." | |
| concurrency: | |
| group: testflight | |
| cancel-in-progress: false | |
| jobs: | |
| beta: | |
| name: Beta to TestFlight | |
| runs-on: macos-15 | |
| timeout-minutes: 60 | |
| environment: testflight | |
| env: | |
| LC_ALL: en_US.UTF-8 | |
| LANG: en_US.UTF-8 | |
| APP_BUNDLE_ID: com.jiejuefuyou.autochoice | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select latest stable Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Install xcodegen + imagemagick | |
| run: brew install xcodegen imagemagick | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| - name: Setup SSH deploy key for autoapp-certs | |
| env: | |
| MATCH_SSH_KEY: ${{ secrets.MATCH_SSH_KEY }} | |
| run: | | |
| set -eux | |
| mkdir -p ~/.ssh | |
| chmod 700 ~/.ssh | |
| echo "$MATCH_SSH_KEY" | base64 -d > ~/.ssh/autoapp_match_deploy | |
| chmod 600 ~/.ssh/autoapp_match_deploy | |
| ssh-keyscan -t ed25519 github.com >> ~/.ssh/known_hosts 2>/dev/null | |
| chmod 644 ~/.ssh/known_hosts | |
| cat > ~/.ssh/config <<EOF | |
| Host github.com | |
| HostName github.com | |
| User git | |
| IdentityFile ~/.ssh/autoapp_match_deploy | |
| IdentitiesOnly yes | |
| StrictHostKeyChecking yes | |
| EOF | |
| chmod 600 ~/.ssh/config | |
| ssh -T git@github.com 2>&1 | grep -i "successfully authenticated" || echo "(SSH auth check non-fatal)" | |
| - name: Run unit tests | |
| run: bundle exec fastlane test | |
| - name: Build & upload TestFlight | |
| env: | |
| ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} | |
| ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | |
| ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| MATCH_GIT_URL: git@github.com:jiejuefuyou/autoapp-certs.git | |
| MATCH_GIT_BRANCH: main | |
| FASTLANE_USER: ${{ secrets.FASTLANE_USER }} | |
| TEAM_ID: ${{ secrets.TEAM_ID }} | |
| ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }} | |
| BETA_CHANGELOG: ${{ github.event.inputs.changelog || format('Build from commit {0}', github.sha) }} | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| run: bundle exec fastlane beta |