Skip to content

Instantly share code, notes, and snippets.

@jckw
Created November 9, 2021 21:05
Show Gist options
  • Save jckw/f6cb8ff8eef2f36cab8106402d7e6ebd to your computer and use it in GitHub Desktop.
Save jckw/f6cb8ff8eef2f36cab8106402d7e6ebd to your computer and use it in GitHub Desktop.
A simple Github Actions workflow for releasing TestFlight builds with Fastlane.
name: Release to TestFlight internally and bump build number
on: [workflow_dispatch]
jobs:
internal_testflight:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
# We use a deploy key (i.e. public key) in the Houston-App/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/[email protected]
with:
ssh-private-key: ${{ secrets.CERT_REPO_DEPLOY_PRIVATE_KEY }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Use yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Use Pod cache
uses: actions/cache@v2
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Use [email protected]
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install packages and pods
run: yarn install --frozen-lockfile --prefer-offline && npx pod-install
- name: Install FastLane
run: cd ios && gem install fastlane -NV
- name: Build and Release
env:
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 }}
run: cd ios && fastlane ios beta
- name: Commit build number increment
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Bump build number." -a
- name: Commit build increment
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