Last active
October 11, 2022 19:56
-
-
Save ishaquehassan/c3e139c410e4203e9f30affb32acc13b to your computer and use it in GitHub Desktop.
yml
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
<?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>method</key> | |
<string>app-store</string> | |
<key>teamID</key> | |
<string>T1W23Z4N56</string> | |
<key>teamName</key> | |
<string>POCKET SYSTEMS</string> | |
<key>provisioningProfiles</key> | |
<dict> | |
<key>net.pocketsystems.ios</key> | |
<string>test-release</string> | |
</dict> | |
</dict> | |
</plist> |
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: Testing-iOS-CD | |
# Repository Secrets needed to execute this workflow | |
# ================================================== | |
# APP_STORE_PASSWORD : https://support.apple.com/en-us/HT204397 | |
# APP_STORE_USERNAME : Apple developer account username with access to upload & manage apps | |
# IOS_CERTIFICATE : Certificate to distribute ios app with specific bundle identifier | |
# IOS_STAGE_PROVISIONING_PROFILE : Staging Provisioning profile for the app associated with same certificate as above | |
# IOS_QA_PROVISIONING_PROFILE : QA Provisioning profile for the app associated with same certificate as above | |
# PROVISIONING_PROFILE & CERTIFICATE can be copied for GA-Actions using : base64 file_name.ext | pbcopy | |
# ================================================== | |
# Optional | |
# ================================================== | |
# IOS_CERTIFICATE_PWD : Password for the .p12 key certificate to import in github macos VM keychain | |
# ================================================== | |
on: | |
push: | |
branches: | |
- ios/test-release | |
env: | |
flutter_version: "3.0.4" | |
java_version: "12.x" | |
jobs: | |
build: | |
name: Build and Release | |
runs-on: macos-latest | |
env: | |
IOS_APP_RELEASE_PATH: build/ios/Release-stage-iphoneos | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ env.java_version }} | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v1 | |
with: | |
path: /Users/runner/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }} | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
channel: 'stable' | |
- name: Pub Get Packages | |
run: flutter pub get | |
- name: Import signing certificate | |
env: | |
SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.IOS_CERTIFICATE }} | |
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PWD }} | |
run: | | |
exec .github/scripts/import-certificate.sh | |
- name: Import provisioning profile | |
env: | |
PROVISIONING_PROFILE_DATA: ${{ secrets.IOS_PROVISIONING_PROFILE }} | |
run: | | |
exec .github/scripts/import-profile.sh | |
- name: Removing pods | |
run: rm -rf ios/Pods && rm -f ios/Podfile.lock && rm -f ios/Flutter/Flutter.podspec | |
- name: Installing and updating pods | |
run: cd ios && pod install && cd .. | |
- name: Archive iOS | |
run: flutter build xcarchive | |
- name: Export Staging IPA from archive | |
run: xcodebuild -exportArchive -archivePath "build/ios/archive/Runner.xcarchive" -exportOptionsPlist ios/exportOptions.plist -exportPath build/ios/ipa/ -allowProvisioningUpdates | |
- name: Upload to App Store | |
run: xcrun altool --upload-app -f "./build/ios/ipa/IOS_APP.ipa" --type ios -u ${{secrets.APP_STORE_USERNAME}} -p ${{secrets.APP_STORE_PASSWORD}} | |
Footer |
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
#!/bin/bash | |
set -euo pipefail | |
security create-keychain -p "" build.keychain | |
security list-keychains -s build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "" build.keychain | |
security set-keychain-settings | |
security import <(echo $SIGNING_CERTIFICATE_P12_DATA | base64 --decode) \ | |
-f pkcs12 \ | |
-k build.keychain \ | |
-P "" \ | |
-T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain |
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
#!/bin/bash | |
set -euo pipefail | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
echo "$PROVISIONING_PROFILE_DATA" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/embedded.mobileprovision |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment