From 707a6ecbaa18a324b1340d3b559f816940337460 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 9 Jun 2020 11:37:40 -0400 Subject: [PATCH] setup ios keychain --- .github/scripts/ios/setup-keychain.ps1 | 11 +++++++++++ .github/workflows/build.yml | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 .github/scripts/ios/setup-keychain.ps1 diff --git a/.github/scripts/ios/setup-keychain.ps1 b/.github/scripts/ios/setup-keychain.ps1 new file mode 100644 index 000000000..9d29c2489 --- /dev/null +++ b/.github/scripts/ios/setup-keychain.ps1 @@ -0,0 +1,11 @@ +$homePath = $env:HOME; +$secretsPath = $homePath + "\secrets" + +$mobileKeyPath = $($secretsPath + "\bitwarden-mobile-key.p12"); +$distCertPath = $($secretsPath + "\iphone-distribution-cert.p12"); + +security create-keychain -p $env:KEYCHAIN_PASSWORD build.keychain +security default-keychain -s build.keychain +security unlock-keychain -p $env:KEYCHAIN_PASSWORD build.keychain +security import $mobileKeyPath -k build.keychain -P $env:MOBILE_KEY_PASSWORD +security import $distCertPath -k build.keychain -P $env:DIST_CERT_PASSWORD diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46c12d1f6..f84bb6e1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,6 +128,15 @@ jobs: env: DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }} + - name: Set up keychain + if: github.ref == 'refs/heads/master' + run: ./.github/scripts/ios/setup-keychain.ps1 + shell: pwsh + env: + KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWORD }} + MOBILE_KEY_PASSWORD: ${{ secrets.IOS_KEY_PASSWORD }} + DIST_CERT_PASSWORD: ${{ secrets.IOS_DIST_CERT_PASSWORD }} + - name: Restore packages run: nuget restore