diff --git a/.github/scripts/archive_app.sh b/.github/scripts/archive_app.sh new file mode 100755 index 00000000..4f30611b --- /dev/null +++ b/.github/scripts/archive_app.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -eo pipefail + +xcodebuild -workspace Decred\ Wallet.xcworkspace \ + -scheme Decred\ Wallet\ Testnet \ + -sdk iphoneos \ + -configuration Testnet\ Release \ + -archivePath $PWD/build/Decred\ Wallet.xcarchive \ + -allowProvisioningUpdates \ + CODE_SIGN_IDENTITY="iPhone Distribution" \ + PROVISIONING_PROFILE="b6b99236-cee8-4bab-abc8-1735c701853a" \ + CODE_SIGN_STYLE="Manual" \ + DEVELOPMENT_TEAM="UX9L95U548" \ + clean archive | xcpretty diff --git a/.github/scripts/export_ipa.sh b/.github/scripts/export_ipa.sh new file mode 100755 index 00000000..e5ee2a0f --- /dev/null +++ b/.github/scripts/export_ipa.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -eo pipefail + +xcodebuild -archivePath $PWD/build/Decred\ Wallet.xcarchive \ + -exportOptionsPlist Decred\ Wallet/exportOptions.plist \ + -exportPath $PWD/build \ + -allowProvisioningUpdates \ + -exportArchive | xcpretty diff --git a/.github/scripts/publish_testflight.sh b/.github/scripts/publish_testflight.sh new file mode 100755 index 00000000..aeced0ad --- /dev/null +++ b/.github/scripts/publish_testflight.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eo pipefail + +xcrun altool --upload-app -t ios -f build/Decred\ Wallet\ Testnet.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose diff --git a/.github/secrets/DistributeCertificatesRaedah.p12.gpg b/.github/secrets/DistributeCertificatesRaedah.p12.gpg new file mode 100644 index 00000000..c57620f1 Binary files /dev/null and b/.github/secrets/DistributeCertificatesRaedah.p12.gpg differ diff --git a/.github/secrets/dcriostestnet.mobileprovision.gpg b/.github/secrets/dcriostestnet.mobileprovision.gpg new file mode 100644 index 00000000..a93412a8 Binary files /dev/null and b/.github/secrets/dcriostestnet.mobileprovision.gpg differ diff --git a/.github/secrets/decrypt_secrets.sh b/.github/secrets/decrypt_secrets.sh new file mode 100755 index 00000000..33d11579 --- /dev/null +++ b/.github/secrets/decrypt_secrets.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -eo pipefail + +gpg --quiet --batch --yes --decrypt --passphrase="$IOS_KEYS" --output ./.github/secrets/dcriostestnet.mobileprovision.mobileprovision ./.github/secrets/dcriostestnet.mobileprovision.gpg +gpg --quiet --batch --yes --decrypt --passphrase="$IOS_KEYS" --output ./.github/secrets/DistributeCertificatesRaedah.p12 ./.github/secrets/DistributeCertificatesRaedah.p12.gpg + +mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + +cp ./.github/secrets/dcriostestnet.mobileprovision.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/dcriostestnet.mobileprovision.mobileprovision + + +security create-keychain -p "" build.keychain +security import ./.github/secrets/DistributeCertificatesRaedah.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 + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a93ed57..fdd45eb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,3 +39,69 @@ jobs: # - name: Test Dcrios # run: xcodebuild -workspace Decred\ Wallet.xcworkspace -scheme Decred\ Wallet\ Testnet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' clean test + + - name: Upload Dcrios Folder + if: github.ref == 'refs/heads/master' + uses: actions/upload-artifact@v1 + with: + name: Dcrios + path: /Users/runner/work/dcrios/dcrios + + deploy: + name: Deploying to Testflight + runs-on: macOS-latest + needs: testing + if: success() && github.ref == 'refs/heads/master' + steps: + - name: Download Dcrios Folder + uses: actions/download-artifact@v1 + with: + name: Dcrios + + - name: Install gpg + run: brew install gnupg + + - name: Setup provisioning profile + env: + IOS_KEYS: ${{ secrets.IOS_KEYS }} + run: | + chmod -R 755 ./ + chmod +x ./.github/secrets/decrypt_secrets.sh + ./.github/secrets/decrypt_secrets.sh + working-directory: Dcrios + + - name: Archiving project + env: + PR_NUMBER: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + run: | + chmod +x ./.github/scripts/archive_app.sh + ./.github/scripts/archive_app.sh + working-directory: Dcrios + + - name: Exporting .ipa + run: | + chmod +x ./.github/scripts/export_ipa.sh + ./.github/scripts/export_ipa.sh + working-directory: Dcrios + + - name: Upload Testnet IPA + uses: actions/upload-artifact@v1 + with: + name: Decred Wallet Testnet (debug ipa) + path: Dcrios/build/Decred\ Wallet\ Testnet.ipa + + - name: Publishing app + if: success() + env: + APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }} + APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }} + run: | + chmod +x ./.github/scripts/publish_testflight.sh + ./.github/scripts/publish_testflight.sh + working-directory: Dcrios + + - name: Delete Dcrios Folder + uses: geekyeggo/delete-artifact@v1 + with: + name: Dcrios + failOnError: false diff --git a/Decred Wallet/exportOptions.plist b/Decred Wallet/exportOptions.plist new file mode 100644 index 00000000..f058fd45 --- /dev/null +++ b/Decred Wallet/exportOptions.plist @@ -0,0 +1,25 @@ + + + + + method + app-store + provisioningProfiles + + com.decred.dcrios.testnet3 + b6b99236-cee8-4bab-abc8-1735c701853a + + signingCertificate + iPhone Distribution + signingStyle + manual + stripSwiftSymbols + + teamID + UX9L95U548 + uploadBitcode + + uploadSymbols + + + diff --git a/Podfile b/Podfile index 89ff598e..c52ab090 100644 --- a/Podfile +++ b/Podfile @@ -16,6 +16,9 @@ post_install do |pi| pi.pods_project.targets.each do |t| t.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' + config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = "" + config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" + config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" end end end diff --git a/Podfile.lock b/Podfile.lock index 3450f15d..bbd1f10d 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -23,6 +23,6 @@ SPEC CHECKSUMS: QRCodeReader.swift: 373a389fe9a22d513c879a32a6f647c58f4ef572 SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c -PODFILE CHECKSUM: 2cbcbe327300b72152a1957cbb4dfd3fa4136777 +PODFILE CHECKSUM: 071a1b7b56d23179e1e807ba8d3550ae6b1ca129 COCOAPODS: 1.11.2