Skip to content

Commit bf59633

Browse files
committed
Add step to build workflow
1 parent f621759 commit bf59633

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v1
1111

12+
- name: Install the Apple certificate and provisioning profile
13+
env:
14+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
15+
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
16+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
17+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
18+
run: |
19+
# create variables
20+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
21+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
22+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
23+
24+
# import certificate and provisioning profile from secrets
25+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
26+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
27+
28+
# create temporary keychain
29+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
30+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
31+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
32+
33+
# import certificate to keychain
34+
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
35+
security list-keychain -d user -s $KEYCHAIN_PATH
36+
37+
# apply provisioning profile
38+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
39+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
40+
1241
- name: Build App
1342
run: |
1443
cd Demo\ App

0 commit comments

Comments
 (0)