Skip to content

Instantly share code, notes, and snippets.

@huynguyencong
Last active January 13, 2021 10:48
Show Gist options
  • Save huynguyencong/9e592d4c4b5ae3e86990f013ddd6dfa0 to your computer and use it in GitHub Desktop.
Save huynguyencong/9e592d4c4b5ae3e86990f013ddd6dfa0 to your computer and use it in GitHub Desktop.
Github action: On push to release branch, test and build.
# Set ADHOC_CERTIFICATE base64, ADHOC_PROVISIONING base64, ADHOC_CERTIFICATE_PASSWORD to Github secrets
# - File and base64:
# base64 -i <any-file> -o <text-file>
# base64 -D -i <text-file> -o <any-file>
name: Release using fastlane
on:
push:
branches:
- release
jobs:
test:
name: Testing using fastlane
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test
run: fastlane test
- name: Import certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.ADHOC_CERTIFICATE }}
p12-password: ${{ secrets.ADHOC_CERTIFICATE_PASSWORD }}
- name: Import provisioning
run: |
read_file='Provisioning.txt'
provisioning_file='Provisioning.mobileprovision'
touch $read_file
echo $ADHOC_PROVISIONING >> $read_file
base64 -D -i $read_file -o $provisioning_file
uuid=`grep UUID -A1 -a $provisioning_file | grep -io "[-A-F0-9]\{36\}"`
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $provisioning_file ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision
env:
ADHOC_PROVISIONING: ${{ secrets.ADHOC_PROVISIONING }}
- name: Build
run: fastlane adhoc
env:
A_2359_APP_MANAGER_API_KEY: ${{ secrets.A_2359_APP_MANAGER_API_KEY }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment