Merge branch 'dev' #12
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: Deploy | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Apple Certificate | |
env: | |
CERTIFICATE_BASE64: ${{ secrets.IOS_DISTRIBUTION_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.IOS_DISTRIBUTION_CERTIFICATE_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
echo $CERTIFICATE_BASE64 | base64 --decode > certificate.p12 | |
security import certificate.p12 -k build.keychain -P "$P12_PASSWORD" -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain | |
- name: Install Provisioning Profile | |
env: | |
PROVISIONING_PROFILE_BASE64: ${{ secrets.IOS_PROVISION_PROFILE_BASE64 }} | |
run: | | |
echo $PROVISIONING_PROFILE_BASE64 | base64 --decode > profile.mobileprovision | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles | |
- name: Select Xcode | |
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app | |
- name: Xcode version | |
run: /usr/bin/xcodebuild -version | |
- name: Build and Deploy to App Store | |
env: | |
APPLE_ID: ${{ secrets.APPSTORE_USERNAME }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPSTORE_PASSWORD }} | |
run: | | |
xcodebuild clean archive -sdk iphoneos -workspace MorseCodeApp.xcworkspace -scheme "MorseCodeApp" -configuration "Release" -derivedDataPath "DerivedData" -archivePath "DerivedData/Archive/MorseCodeApp.xcarchive" | |
xcodebuild -exportArchive -archivePath DerivedData/Archive/MorseCodeApp.xcarchive -exportOptionsPlist .github/workflows/ExportOptions.plist -exportPath DerivedData/ipa | |
xcrun altool --upload-app --type ios --file "DerivedData/ipa/MorseCodeApp.ipa" --username "${{ secrets.APPSTORE_USERNAME }}" --password "${{ secrets.APPSTORE_PASSWORD }}" --verbose |