Created
January 10, 2020 23:17
-
-
Save tsanto/8cc6ef6aa3a79946d3a4f5e91853ddff to your computer and use it in GitHub Desktop.
Files used in this repo @/tsanto/Calculator-github-actions to deploy an iOS app.
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 -eo pipefail | |
xcodebuild -workspace Calculator.xcworkspace \ | |
-scheme Calculator\ iOS \ | |
-sdk iphoneos \ | |
-configuration AppStoreDistribution \ | |
-archivePath $PWD/build/Calculator.xcarchive \ | |
clean archive | xcpretty |
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/sh | |
set -eo pipefail | |
gpg --quiet --batch --yes --decrypt --passphrase="$IOS_KEYS" --output ./.github/secrets/match_AppStore_comtiagosantocalculatorIOS.mobileprovision.mobileprovision ./.github/secrets/match_AppStore_comtiagosantocalculatorIOS.mobileprovision.gpg | |
gpg --quiet --batch --yes --decrypt --passphrase="$IOS_KEYS" --output ./.github/secrets/Certificates.p12 ./.github/secrets/Certificates.p12.gpg | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp ./.github/secrets/match_AppStore_comtiagosantocalculatorIOS.mobileprovision.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/match_AppStore_comtiagosantocalculatorIOS.mobileprovision.mobileprovision | |
security create-keychain -p "" build.keychain | |
security import ./.github/secrets/Certificates.p12 -t agg -k ~/Library/Keychains/build.keychain -P "" -A | |
security list-keychains -s ~/Library/Keychains/build.keychain | |
security default-keychain -s ~/Library/Keychains/build.keychain | |
security unlock-keychain -p "" ~/Library/Keychains/build.keychain | |
security set-key-partition-list -S apple-tool:,apple: -s -k "" ~/Library/Keychains/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
name: Deploying | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
name: Deploying to Testflight | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
- name: Install gpg | |
run: brew install gnupg | |
- name: Setup provisioning profile | |
env: | |
IOS_KEYS: ${{ secrets.IOS_KEYS }} | |
run: ./.github/secrets/decrypt_secrets.sh | |
- name: Archiving project | |
env: | |
PR_NUMBER: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
run: ./.github/scripts/archive_app.sh | |
- name: Exporting .ipa | |
run: ./.github/scripts/export_ipa.sh | |
- name: Publishing app | |
if: success() | |
env: | |
APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }} | |
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }} | |
run: ./.github/scripts/publish_testflight.sh |
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 -eo pipefail | |
xcodebuild -archivePath $PWD/build/Calculator.xcarchive \ | |
-exportOptionsPlist Calculator-iOS/Calculator\ iOS/exportOptions.plist \ | |
-exportPath $PWD/build \ | |
-allowProvisioningUpdates \ | |
-exportArchive | xcpretty |
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 -eo pipefail | |
xcrun altool --upload-app -t ios -f build/Calculator\ iOS.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment