configured fastlane config #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PREVISION CI | |
on: | |
pull_request: | |
branches: [ main ] # Trigger for PRs to main branch | |
env: | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
jobs: | |
ios_build: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Install dependencies | |
run: npm install -g yarn | |
- name: Install Yarn | |
run: yarn install | |
- name: Install CocoaPods | |
run: sudo gem install cocoapods | |
- name: Install Algolia Gem | |
run: sudo gem install algolia | |
- name: Install Bundler | |
run: gem install bundler | |
- name: Install Pods | |
run: cd ios && pod install | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7.4' | |
- name: Install the Apple certificate and provisioning profile | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | |
security cms -D -i $PP_PATH | |
- name: Build and archive | |
run: | | |
cd ios | |
xcodebuild archive -workspace NavigatorApp.xcworkspace -scheme NavigatorApp -archivePath build/NavigatorApp.xcarchive | |
xcodebuild -exportArchive -archivePath -allowProvisioningUpdates build/NavigatorApp.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath build | |
- name: Upload to App Store Connect | |
run: | | |
xcrun altool --upload-app -f build/NavigatorApp.ipa -u $APPLE_ID -p $APPLE_PASSWORD --output-format xml | |
- name: Verify upload status | |
run: | | |
xcrun altool --check-upload-status -f build/NavigatorApp.ipa -u $APPLE_ID -p $APPLE_PASSWORD --output-format xml |