Skip to content

Commit 87679b7

Browse files
authored
Merge pull request #667 from BlueBubblesApp/development
codesign for github actions
2 parents e075cbb + 77c98ce commit 87679b7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,35 @@ jobs:
2626
node-version: '20.11'
2727
- name: Install Dependencies
2828
run: npm install
29+
- name: Install the Apple certificate and provisioning profile
30+
env:
31+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
32+
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
33+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
34+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
35+
run: |
36+
# create variables
37+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
38+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
39+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
40+
41+
# import certificate and provisioning profile from secrets
42+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
43+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
44+
45+
# create temporary keychain
46+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
47+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
48+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
49+
50+
# import certificate to keychain
51+
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
52+
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
53+
security list-keychain -d user -s $KEYCHAIN_PATH
54+
55+
# apply provisioning profile
56+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
57+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
2958
- name: Build & Publish BlueBubbles
3059
env:
3160
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)