Skip to content

Register new iOS device to Apple Developer account #25

Register new iOS device to Apple Developer account

Register new iOS device to Apple Developer account #25

# Automation to allow employees in the company to download and install our internal iOS apps.
# This workflow is designed to be executed automatically by Firebase when a new device is added.
# But, if needed, you can also run it manually from the GitHub website.
name: Register new iOS device to Apple Developer account
on:
workflow_dispatch: # manually run the action from GitHub website or from GitHub API
inputs:
ios_device_udid:
description: 'iOS Device UDID'
required: true
type: string
device_model_name:
description: 'Device model of the iOS device (Example: iPhone 14 Pro)'
required: true
type: string
device_tester_email:
description: 'Email address for who owns this iOS device'
required: true
type: string
# Secrets required on github repository to run this workflow.
# View CI_SETUP.md doc on how to find the values for these secrets.
env:
GOOGLE_CLOUD_MATCH_WRITE_SERVICE_ACCOUNT_B64: ${{ secrets.GOOGLE_CLOUD_MATCH_WRITE_SERVICE_ACCOUNT_B64 }}
APP_STORE_CONNECT_API_KEY_CONTENT_B64: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT_B64 }}
jobs:
register-new-device:
runs-on: ubuntu-latest
steps:
- name: Hide the inputs values to keep them private in the logs when running this workflow
uses: levibostian/action-hide-sensitive-inputs@v1
- uses: actions/checkout@v4
- name: Install Fastlane (via ruby and Bundler) used for managing code signing files
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Register new iOS device to company Apple Developer account
# runs function inside of fastlane/Fastfile
run: bundle exec fastlane register_new_ios_device ios_device_udid:"${{ inputs.ios_device_udid }}" device_tester_email:"${{ inputs.device_tester_email }}" device_model_name:"${{ inputs.device_model_name }}"
# Apple requires that code signing files get re-created after adding a new test device to Developer account in order for new app builds to be installable by this new iOS device.
- name: Recrete code signing files to include new test device
run: bundle exec fastlane create_all_code_signing_files
# Below, we can now trigger other CI server jobs to make new builds of iOS apps so the new tester
# is able to download builds right now.
# - name: Create new build of Remote Habits for tester to be able to download right now
# uses: benc-uk/workflow-dispatch@v1
# with:
# workflow: manual-build.yml
# repo: customerio/RemoteHabits-iOS
# token: ${{ secrets.GH_TOKEN_TRIGGER_WORKFLOW_IOS_REPOSITORY }}
# Optionally: send an email via CIO to the tester :)
# - name: Send email to tester saying we have added them to the account