Skip to content

[#546] Support adding new devices directly from Github Action #14

[#546] Support adding new devices directly from Github Action

[#546] Support adding new devices directly from Github Action #14

name: Test Add device and regenerate profiles with fastlane match
# SECRETS needed:
### SSH_PRIVATE_KEY for the match Repo
### MATCH_PASSWORD
on:
pull_request:
workflow_dispatch:
inputs:
devices:
description: 'JSON of devices. `{"Luka iPhone 6": "1234567890123456789012345678901234567890","Felix iPad Air 2": "abcdefghijklmnopqrstvuwxyzabcdefghijklmn"}`'
required: true
type: string
platform:
description: 'The platform'
required: true
default: 'ios'
type: choice
options:
- ios
- mac
jobs:
create_files:
name: Create certificates and profiles
runs-on: macOS-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Cache Pods
uses: actions/cache@v3
id: cocoapodCache
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Start Install Script for Template App
run: swift run --package-path Scripts/Swift/iOSTemplateMaker iOSTemplateMaker make --bundle-id-production co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp --interface UIKit
- name: Start Setup Script for Template App Firebase Upload
run: swift run --package-path Scripts/Swift/iOSTemplateMaker iOSTemplateMaker make-test-firebase
env:
MATCH_REPO: ${{ secrets.MATCH_REPO }}
STAGING_FIREBASE_APP_ID: ${{ secrets.STAGING_FIREBASE_APP_ID }}
TEAM_ID: ${{ secrets.TEAM_ID }}
- name: Set Up Test Project for Firebase
run: bundle exec fastlane setUpTestProject
- name: Bundle install
run: bundle install
- name: Decode APPSTORE_CONNECT_API_KEY Base64 Secret
env:
ENCODED_SECRET: ${{ secrets.APPSTORE_CONNECT_API_KEY }}
run: |
DECODED_SECRET=$(echo "$ENCODED_SECRET" | base64 -d)
echo "DECODED_APPSTORE_CONNECT_API_KEY=$(echo $DECODED_SECRET | cut -c 1-6)" >> $GITHUB_ENV
- name: Add device and regenerate profiles with match
run: bundle exec fastlane addDevicesGenerateProfiles
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}
DEVICES: '{"Luka iPhone 6": "1234567890123456789012345678901234567890","Felix iPad Air 2": "abcdefghijklmnopqrstvuwxyzabcdefghijklmn"}'
APPSTORE_CONNECT_API_KEY: $DECODED_APPSTORE_CONNECT_API_KEY
API_KEY_ID: ${{ secrets.API_KEY_ID }}
ISSUER_ID: ${{ secrets.ISSUER_ID }}
PLATFORM: "ios"
- name: Clean up keychain
if: ${{ always() }}
run: bundle exec fastlane remove_keychain
continue-on-error: true