iOS release #1
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: iOS release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
jobs: | |
code-quality: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Unit tests | |
run: ./gradlew testDebugUnitTest | |
build_and_release: | |
needs: code-quality | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} | |
- name: Cache KMP tooling | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.konan | |
key: ${{ runner.os }}-v1-${{ hashFiles('*.versions.toml') }} | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Import certs | |
uses: apple-actions/import-codesign-certs@v3 | |
with: | |
p12-file-base64: ${{ secrets.IOS_CERTIFICATES_P12 }} | |
p12-password: ${{ secrets.IOS_CERTIFICATES_PASSWORD }} | |
- name: Download provisioning profiles | |
uses: apple-actions/download-provisioning-profiles@v3 | |
with: | |
bundle-id: ${{ secrets.IOS_BUNDLE_ID }} | |
issuer-id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }} | |
api-key-id: ${{ secrets.IOS_APPSTORE_KEY_ID }} | |
api-private-key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }} | |
- name: Build archive | |
run: | | |
cd iosApp | |
xcrun xcodebuild \ | |
-scheme "iosApp" \ | |
-configuration "Release" \ | |
-sdk "iphoneos" \ | |
-parallelizeTargets \ | |
-showBuildTimingSummary \ | |
-disableAutomaticPackageResolution \ | |
-derivedDataPath "${RUNNER_TEMP}/Build/DerivedData" \ | |
-archivePath "${RUNNER_TEMP}/Build/Archives/cpuinfo.xcarchive" \ | |
-resultBundlePath "${RUNNER_TEMP}/Build/Artifacts/cpuinfo.xcresult" \ | |
-destination "generic/platform=iOS" \ | |
DEVELOPMENT_TEAM="${{ secrets.IOS_APPSTORE_TEAM_ID }}" \ | |
PRODUCT_BUNDLE_IDENTIFIER="${{ secrets.IOS_BUNDLE_ID }}" \ | |
CODE_SIGN_STYLE="Manual" \ | |
PROVISIONING_PROFILE_SPECIFIER="${{ secrets.IOS_DEV_PROVISIONING_PROFILE_NAME }}" \ | |
archive | |
- name: "Generate ExportOptions.plist" | |
run: | | |
cat <<EOF > ${RUNNER_TEMP}/Build/ExportOptions.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>destination</key> | |
<string>export</string> | |
<key>method</key> | |
<string>app-store</string> | |
<key>signingStyle</key> | |
<string>manual</string> | |
<key>generateAppStoreInformation</key> | |
<true/> | |
<key>stripSwiftSymbols</key> | |
<true/> | |
<key>teamID</key> | |
<string>${{ secrets.IOS_APPSTORE_TEAM_ID }}</string> | |
<key>uploadSymbols</key> | |
<true/> | |
<key>provisioningProfiles</key> | |
<dict> | |
<key>${{ secrets.IOS_BUNDLE_ID }}</key> | |
<string>${{ secrets.IOS_DIST_PROVISIONING_PROFILE_NAME }}</string> | |
</dict> | |
</dict> | |
</plist> | |
EOF | |
- id: build_ipa | |
name: Build IPA | |
run: | | |
xcrun xcodebuild \ | |
-exportArchive \ | |
-exportOptionsPlist "${RUNNER_TEMP}/Build/ExportOptions.plist" \ | |
-archivePath "${RUNNER_TEMP}/Build/Archives/cpuinfo.xcarchive" \ | |
-exportPath "${RUNNER_TEMP}/Build/Archives/cpuinfo.xcarchive" \ | |
PRODUCT_BUNDLE_IDENTIFIER="${{ secrets.IOS_BUNDLE_ID }}" | |
echo "ipa_path=${RUNNER_TEMP}/Build/Archives/cpuinfo.xcarchive/iosApp.ipa" >> $GITHUB_ENV | |
- uses: Apple-Actions/upload-testflight-build@v1 | |
with: | |
app-path: ${{ env.ipa_path }} | |
issuer-id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }} | |
api-key-id: ${{ secrets.IOS_APPSTORE_KEY_ID }} | |
api-private-key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }} |