Skip to content

Check cancellation before reporting error #216

Check cancellation before reporting error

Check cancellation before reporting error #216

Workflow file for this run

name: Deploy Testflight
on:
push:
tags:
- testflight/v[0-9]+.[0-9]+.[0-9]+-*.[0-9]+
- appstore/v[0-9]+.[0-9]+.[0-9]+-*.[0-9]+
jobs:
deploy:
name: Execute fastlane for testflight / appstore
defaults:
run:
working-directory: ./SNUTT-2022
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_DEPLOY_KEY: ${{ secrets.MATCH_DEPLOY_KEY }}
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_KEY_ISSUER: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER }}
APP_STORE_CONNECT_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_KEY_CONTENT }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GIT_PAT_READONLY: ${{ secrets.GIT_PAT_READONLY }}
GIT_TAG_NAME: ${{ github.ref_name }}
XCODE_VERSION: "15.1"
runs-on: macos-14
steps:
- name: Parse tag name
uses: actions-ecosystem/action-regex-match@v2
id: regex
with:
text: ${{ github.ref_name }}
regex: '^(testflight|appstore)\/v(\d+)\.(\d+)\.(\d+)-(release|debug)\.(\d+)$'
- if: ${{ steps.regex.outputs.group1 == 'appstore' && steps.regex.outputs.group5 == 'debug' }}
run: |
echo "you can't upload debug build to appstore!"
exit 1
- uses: actions/checkout@v3
- run: |
sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer
ls
- name: Set version number and build number
run: |
echo "VERSION_NUMBER=${{ steps.regex.outputs.group2 }}.${{ steps.regex.outputs.group3 }}.${{ steps.regex.outputs.group4 }}" >> $GITHUB_ENV
echo "BUILD_NUMBER=${{ steps.regex.outputs.group6 }}" >> $GITHUB_ENV
- name: Install Ruby Dependencies
run: |
bundle install
bundle update fastlane
- name: Setup git ssh - repo mapping
uses: shaunco/ssh-agent@git-repo-mapping
with:
ssh-private-key: ${{ secrets.MATCH_DEPLOY_KEY }}
repo-mappings: github.com/wafflestudio/wafflestudio-apple-certificates
- name: Configure ssh agent
env:
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "$MATCH_DEPLOY_KEY"
- name: Install imageMagick dependency (for adding badge to app icon)
run: |
brew install libsodium
brew install imagemagick
- name: Inject secret file dependencies
env:
DEBUG_CONFIG: ${{ secrets.DEBUG_CONFIG }}
RELEASE_CONFIG: ${{ secrets.RELEASE_CONFIG }}
GOOGLE_SERVICE_DEBUG_INFO: ${{ secrets.GOOGLE_SERVICE_DEBUG_INFO }}
GOOGLE_SERVICE_RELEASE_INFO: ${{ secrets.GOOGLE_SERVICE_RELEASE_INFO }}
run: |
echo "$GOOGLE_SERVICE_RELEASE_INFO" > SNUTT/GoogleServiceReleaseInfo.plist
echo "$GOOGLE_SERVICE_DEBUG_INFO" > SNUTT/GoogleServiceDebugInfo.plist
echo "$DEBUG_CONFIG" > SNUTT/DebugConfig.xcconfig
echo "$RELEASE_CONFIG" > SNUTT/ReleaseConfig.xcconfig
- name: Upload dev app to TestFlight
if: ${{ steps.regex.outputs.group1 == 'testflight' && steps.regex.outputs.group5 == 'debug' }}
run: |
bundle exec fastlane beta --env dev
- name: Upload prod app to TestFlight
if: ${{ steps.regex.outputs.group1 == 'testflight' && steps.regex.outputs.group5 == 'release' }}
run: |
bundle exec fastlane beta --env prod
- name: Upload prod app to App Store
if: ${{ steps.regex.outputs.group1 == 'appstore' && steps.regex.outputs.group5 == 'release' }}
run: |
bundle exec fastlane release --env prod