2023-11-23 20:29:47 -04:00
|
|
|
name: BuildReleaseTestflight
|
2023-12-03 08:50:19 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-11-23 20:29:47 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-12-03 10:39:25 -04:00
|
|
|
runs-on: macos-latest
|
2023-11-23 20:29:47 -04:00
|
|
|
timeout-minutes: 180
|
|
|
|
env:
|
|
|
|
APPLE_ID: ${{ secrets.APPLE_ID }} # Setting the environment variable
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
|
|
with:
|
|
|
|
xcode-version: latest-stable
|
|
|
|
|
|
|
|
- name: Cache Ruby Gems
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: vendor/bundle
|
|
|
|
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gem-
|
|
|
|
|
|
|
|
- name: Cache CocoaPods
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ios/Pods
|
|
|
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pods-
|
|
|
|
|
|
|
|
- name: Set up Ruby
|
|
|
|
uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
bundler-cache: true
|
|
|
|
|
|
|
|
- name: Install dependencies with Bundler
|
|
|
|
run: bundle install
|
|
|
|
|
|
|
|
- name: Install Fastlane 2.217.0
|
|
|
|
run: gem install fastlane -v 2.217.0
|
|
|
|
|
|
|
|
- name: Install CocoaPods
|
|
|
|
run: sudo gem install cocoapods
|
2023-12-05 17:30:40 -04:00
|
|
|
|
|
|
|
- name: Clean Workspace
|
|
|
|
run: |
|
|
|
|
rm -rf node_modules
|
2023-12-03 15:10:51 -04:00
|
|
|
|
2023-11-23 20:29:47 -04:00
|
|
|
- name: Install node_modules
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Set up Git Authentication
|
|
|
|
env:
|
|
|
|
ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
|
|
|
|
run: |
|
|
|
|
git config --global credential.helper 'cache --timeout=3600'
|
|
|
|
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${ACCESS_TOKEN} | base64)"
|
|
|
|
|
|
|
|
- name: Create Temporary Keychain
|
|
|
|
run: bundle exec fastlane ios create_temp_keychain
|
|
|
|
working-directory: ./ios
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Setup Provisioning Profiles
|
|
|
|
env:
|
|
|
|
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
|
|
|
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.GIT_ACCESS_TOKEN }}
|
|
|
|
GIT_URL: ${{ secrets.GIT_URL }}
|
|
|
|
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
|
|
|
|
ITC_TEAM_NAME: ${{ secrets.ITC_TEAM_NAME }}
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
run: bundle exec fastlane ios setup_provisioning_profiles
|
|
|
|
working-directory: ./ios
|
|
|
|
|
|
|
|
- name: Clear Derived Data
|
|
|
|
run: bundle exec fastlane ios clear_derived_data_lane
|
|
|
|
working-directory: ./ios
|
|
|
|
|
2023-12-06 11:43:20 -04:00
|
|
|
- name: Generate Build Number
|
|
|
|
run: echo "NEW_BUILD_NUMBER=$(date +%s)" >> $GITHUB_ENV
|
|
|
|
|
2023-11-23 20:29:47 -04:00
|
|
|
- name: Increment Build Number
|
2023-12-06 11:43:20 -04:00
|
|
|
env:
|
|
|
|
NEW_BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }}
|
2023-11-23 20:29:47 -04:00
|
|
|
run: bundle exec fastlane ios increment_build_number_lane
|
|
|
|
working-directory: ./ios
|
|
|
|
|
|
|
|
- name: Install CocoaPods Dependencies
|
|
|
|
run: bundle exec fastlane ios install_pods
|
|
|
|
working-directory: ./ios
|
|
|
|
|
|
|
|
- name: Build App
|
2023-12-06 11:43:20 -04:00
|
|
|
env:
|
|
|
|
NEW_BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }}
|
2023-11-23 20:29:47 -04:00
|
|
|
run: bundle exec fastlane ios build_app_lane
|
|
|
|
working-directory: ./ios
|
|
|
|
|
2023-12-04 15:15:01 -04:00
|
|
|
- name: Get Latest Commit Message
|
2023-12-06 11:13:11 -04:00
|
|
|
run: |
|
|
|
|
LATEST_COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")
|
|
|
|
echo "LATEST_COMMIT_MESSAGE=${LATEST_COMMIT_MESSAGE}" >> $GITHUB_ENV
|
2023-12-04 15:15:01 -04:00
|
|
|
|
2023-12-04 20:52:03 -04:00
|
|
|
- name: Create App Store Connect API Key JSON
|
|
|
|
run: echo '${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}' > ./ios/appstore_api_key.json
|
|
|
|
|
2023-11-23 20:29:47 -04:00
|
|
|
- name: Upload to TestFlight
|
|
|
|
env:
|
2023-12-04 15:15:01 -04:00
|
|
|
LATEST_COMMIT_MESSAGE: ${{ env.LATEST_COMMIT_MESSAGE }}
|
2023-11-23 20:29:47 -04:00
|
|
|
APP_STORE_CONNECT_API_KEY_PATH: $(pwd)/ios/appstore_api_key.p8
|
|
|
|
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
|
|
|
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.GIT_ACCESS_TOKEN }}
|
|
|
|
GIT_URL: ${{ secrets.GIT_URL }}
|
|
|
|
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
|
|
|
|
ITC_TEAM_NAME: ${{ secrets.ITC_TEAM_NAME }}
|
|
|
|
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
|
|
|
|
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
2023-12-06 11:43:20 -04:00
|
|
|
NEW_BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }}
|
2023-12-04 20:26:37 -04:00
|
|
|
run: bundle exec fastlane ios upload_to_testflight_lane
|
2023-11-23 20:29:47 -04:00
|
|
|
working-directory: ./ios
|
|
|
|
|
2023-12-05 17:30:40 -04:00
|
|
|
- name: List contents of the root directory
|
|
|
|
run: ls -l
|
|
|
|
|
|
|
|
- name: List contents of the ios/build directory
|
|
|
|
run: ls -l ios/build
|
|
|
|
|
2023-12-03 15:10:51 -04:00
|
|
|
- name: Read IPA Output Name
|
|
|
|
id: ipa_name
|
2023-12-04 19:26:03 -04:00
|
|
|
run: echo "::set-output name=ipa_output_name::$(cat ios/output_name.txt)"
|
2023-12-03 15:10:51 -04:00
|
|
|
|
2023-12-05 17:30:40 -04:00
|
|
|
- name: Display the Contents of output_name.txt
|
2023-12-06 11:13:11 -04:00
|
|
|
run: cat ios/output_name.txt
|
2023-12-05 17:30:40 -04:00
|
|
|
|
2023-12-03 15:10:51 -04:00
|
|
|
- name: Upload IPA as Artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
2023-12-06 11:43:20 -04:00
|
|
|
env:
|
|
|
|
NEW_BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }}
|
2023-12-03 15:10:51 -04:00
|
|
|
with:
|
|
|
|
name: ${{ steps.ipa_name.outputs.ipa_output_name }}
|
2023-12-05 00:39:09 -04:00
|
|
|
path: ./ios/build/${{ steps.ipa_name.outputs.ipa_output_name }}
|
2023-11-23 20:29:47 -04:00
|
|
|
|
|
|
|
- name: Upload Fastlane logs as Artifact
|
|
|
|
if: always()
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: fastlane-logs
|
|
|
|
path: fastlane.log
|