diff --git a/.github/workflows/ios-test-flight-release.yaml b/.github/workflows/ios-test-flight-release.yaml new file mode 100644 index 00000000..ac6026be --- /dev/null +++ b/.github/workflows/ios-test-flight-release.yaml @@ -0,0 +1,104 @@ +name: "build-test" +on: + push: + tags: + - '*-ios' + +jobs: + build: + runs-on: macos-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + + - name: import certs + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} + p12-password: ${{ secrets.CERTIFICATES_PASSWORD }} + + - name: download provisioning profiles + uses: apple-actions/download-provisioning-profiles@v1 + with: + bundle-id: ${{ secrets.BUNDLE_ID }} + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} + + - name: build archive + env: + PROJECT_DIR: iosApp + SCHEME: FeedFlow + CONFIGURATION: Release + SDK: iphoneos + run: | + cd ${PROJECT_DIR} + + xcrun xcodebuild \ + -workspace "${WORKSPACE}" \ + -scheme "${SCHEME}" \ + -configuration "${CONFIGURATION}" \ + -sdk "${SDK}" \ + -parallelizeTargets \ + -showBuildTimingSummary \ + -disableAutomaticPackageResolution \ + -derivedDataPath "${RUNNER_TEMP}/Build/DerivedData" \ + -archivePath "${RUNNER_TEMP}/Build/Archives/${SCHEME}.xcarchive" \ + -resultBundlePath "${RUNNER_TEMP}/Build/Artifacts/${SCHEME}.xcresult" \ + -destination "generic/platform=iOS" \ + DEVELOPMENT_TEAM="${{ secrets.APPSTORE_TEAM_ID }}" \ + PRODUCT_BUNDLE_IDENTIFIER="${{ secrets.BUNDLE_ID }}" \ + CODE_SIGN_STYLE="Manual" \ + PROVISIONING_PROFILE_SPECIFIER="${{ secrets.DEV_PROVISIONING_PROFILE_NAME }}" \ + archive + + - name: "Generate ExportOptions.plist" + run: | + cat < ${RUNNER_TEMP}/Build/ExportOptions.plist + + + + + destination + export + method + app-store + signingStyle + manual + generateAppStoreInformation + + stripSwiftSymbols + + teamID + ${{ secrets.APPSTORE_TEAM_ID }} + uploadSymbols + + provisioningProfiles + + ${{ secrets.BUNDLE_ID }} + ${{ secrets.DIST_PROVISIONING_PROFILE_NAME }} + + + + EOF + + - id: export_archive + name: export archive + env: + SCHEME: FeedFlow + run: | + xcrun xcodebuild \ + -exportArchive \ + -exportOptionsPlist "${RUNNER_TEMP}/Build/ExportOptions.plist" \ + -archivePath "${RUNNER_TEMP}/Build/Archives/${SCHEME}.xcarchive" \ + -exportPath "${RUNNER_TEMP}/Build/Archives/${SCHEME}.xcarchive/${SCHEME}.ipa" \ + PRODUCT_BUNDLE_IDENTIFIER="${{ secrets.BUNDLE_ID }}" + + echo "ipa_path=${RUNNER_TEMP}/Build/Archives/${SCHEME}.xcarchive/${SCHEME}.ipa/${SCHEME}.ipa" >> $GITHUB_OUTPUT + + - uses: Apple-Actions/upload-testflight-build@v1 + with: + app-path: ${{ steps.export_archive.outputs.ipa_path }} + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} \ No newline at end of file