Skip to content

Publish Beta

Publish Beta #14

Workflow file for this run

name: Publish Beta
on:
workflow_dispatch:
jobs:
publish:
name: Publish
runs-on: macos-14
steps:
- name: Check out Git repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup signing environment
env:
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_KEY_ID_EXPO }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_KEY_CONTENTS_EXPO }}
APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64: true
APP_STORE_CONNECT_API_KEY_DURATION: 1200
APP_STORE_CONNECT_API_KEY_IN_HOUSE: false
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64_EXPO }}
KEYCHAIN_PASSWORD: "CI_PASSWORD"
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
sudo mkdir -p /Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
sudo cp $PP_PATH /Library/MobileDevice/Provisioning\ Profiles
- name: Build and publish beta
run: fastlane beta \
keyID:"${{ secrets.APP_STORE_KEY_ID_EXPO }}" \
issuerID:"${{ secrets.APP_STORE_ISSUER_ID }}" \
keyContents:"${{ secrets.APP_STORE_KEY_CONTENTS_EXPO }}" \
codeSign64:"${{ secrets.CODE_SIGN_64 }}" \
profileName64:"${{ secrets.PROFILE_NAME_64_EXPO }}"