Created
April 17, 2023 15:49
-
-
Save jckw/d1fad319a96159737e6ab6140bc83069 to your computer and use it in GitHub Desktop.
Github Action to create and release iOS and Android internal testing builds / pilots (e.g. TestFlight)
This file contains 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: Create iOS and Android beta builds | |
on: [workflow_dispatch] | |
jobs: | |
safety-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node@16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: Install packages | |
run: yarn install --frozen-lockfile --prefer-offline | |
- name: Type check | |
run: yarn tsc --skipLibCheck | |
beta-prod-android: | |
needs: safety-checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node@16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: Install packages | |
run: yarn install --frozen-lockfile --prefer-offline | |
- name: Install FastLane and other gems | |
run: sudo gem install bundler -NV && sudo bundle install | |
working-directory: android | |
- name: Build and Release Android | |
env: | |
ENV: production | |
SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }} | |
run: bundle exec fastlane android beta | |
working-directory: android | |
- name: Push git | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
beta-prod-ios: | |
needs: safety-checks | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mikehardy/buildcache-action@v2 | |
# We use a deploy key (i.e. public key) in the my-project-name/certificates repo to | |
# access the certificates from this action. The private key is stored as a secret on | |
# this repo | |
- name: Set up SSH agent to access cert repo | |
uses: webfactory/ssh-agent@v0.5.3 | |
with: | |
ssh-private-key: ${{ secrets.CERT_REPO_DEPLOY_PRIVATE_KEY }} | |
- name: Use Node@16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: Install packages | |
run: yarn install --frozen-lockfile --prefer-offline | |
- name: Use Pod cache | |
id: cocoapods-cache | |
uses: actions/cache@v3 | |
with: | |
path: ios/Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Install Pods | |
if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
run: pod install --deployment | |
working-directory: ios | |
- name: Configure Git client | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Install FastLane and other gems | |
run: sudo gem install bundler -NV && sudo bundle install | |
working-directory: ios | |
- name: Build and Release | |
env: | |
ENV: production | |
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }} | |
# Match is Fastlane's certificate and provisioning profile management tool | |
# See https://docs.fastlane.tools/actions/match/ | |
# The certificates are encrypted with a password, stored in this repo's secrets | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: bundle exec fastlane ios beta | |
working-directory: ios | |
- name: Push git | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment