Skip to content

Update ios-deployment.yml #21

Update ios-deployment.yml

Update ios-deployment.yml #21

name: iOS development deployment workflow
on:
push:
branches: [ "release" ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
print_tags:
description: 'True to print to STDOUT'
required: true
type: boolean
tags:
description: 'Test scenario tags'
required: true
type: string
jobs:
deploy:
name: Build and deploy default scheme using any available iPhone simulator
runs-on: macos-13-xlarge
defaults:
run:
working-directory: ./iOS/Layover
env:
XC_VERSION: ${{ '15.0.1' }}
XC_PROJECT: ${{ 'Layover.xcodeproj' }}
XC_ARCHIVE_PATH: ${{ '.Layover.xcarchive' }}
XC_EXPORT_PATH: ${{ '.artifacts' }}
KEYCHAIN: ${{ 'test.keychain' }}
DECRYPTED_CERTS_FILE_PATH: ${{ '../../.github/secrets/certificate.p12' }}
ENCRYPTED_CERTS_FILE_PATH: ${{ '../../.github/secrets/certificate.p12.gpg' }}
DECRYPTED_PROVISION_FILE_PATH: ${{ '../../.github/secrets/profile.mobileprovision' }}
ENCRYPTED_PROVISION_FILE_PATH: ${{ '../../.github/secrets/profile.mobileprovision.gpg' }}
CERTS_ENCRYPTION_PWD: ${{ secrets.CERTS_ENCRYPTION_PWD }}
PROVISION_ENCRYPTION_PWD: ${{ secrets.PROVISION_ENCRYPTION_PWD }}
CERTS_EXPORT_PWD: ${{ secrets.CERTS_EXPORT_PWD }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'
- name: Checkout
uses: actions/checkout@v3
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
echo $default | cat >default
echo Using default scheme: $default
- name: Configure Keychain
run: |
security create-keychain -p "" "$KEYCHAIN"
security list-keychains -s "$KEYCHAIN"
security default-keychain -s "$KEYCHAIN"
security unlock-keychain -p "" "$KEYCHAIN"
security set-keychain-settings
- name: Configure Code Signing
run: |
gpg -d -o "$DECRYPTED_CERTS_FILE_PATH" --pinentry-mode=loopback --passphrase "$CERTS_ENCRYPTION_PWD" "$ENCRYPTED_CERTS_FILE_PATH"
gpg -d -o "$DECRYPTED_PROVISION_FILE_PATH" --pinentry-mode=loopback --passphrase "$PROVISION_ENCRYPTION_PWD" "$ENCRYPTED_PROVISION_FILE_PATH"
security import "$DECRYPTED_CERTS_FILE_PATH" -k "$KEYCHAIN" -P "$CERTS_EXPORT_PWD" -A
security set-key-partition-list -S apple-tool:,apple: -s -k "" "$KEYCHAIN"
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
cd "../../.github/secrets"
echo `ls *.mobileprovision`
for PROVISION in `ls *.mobileprovision`
do
echo Hello, world!
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ./$PROVISION)`
cp "./$PROVISION" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision"
done
- name: Archive
run: |
mkdir artifacts
xcodebuild archive -project Layover.xcodeproj -scheme Layover -destination 'generic/platform=iOS' -configuration Release -archivePath Layover.xcarchive -skipPackagePluginValidation -skipMacroValidation CODE_SIGN_IDENTITY="Apple Development"
- name: Export
run: |
xcodebuild -exportArchive -archivePath Layover.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath "$XC_EXPORT_PATH" -skipPackagePluginValidation -skipMacroValidation
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: ./artifacts