-
Notifications
You must be signed in to change notification settings - Fork 29
52 lines (52 loc) · 2.87 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build
on:
push:
paths: ["**.swift"]
branches: [main]
pull_request:
paths: ["**.swift"]
branches: [main]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: swift-actions/setup-swift@v2
- name: Install Apple Developer ID Application Certificate
env:
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE }}
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD }}
APPLE_DEVELOPER_CERTIFICATE_AUTHORITY: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_AUTHORITY }}
APPLE_DEVELOPER_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_DEVELOPER_KEYCHAIN_PASSWORD }}
run: |
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH="$RUNNER_TEMP/apple-developer-id-application-certificate.p12"
APPLE_DEVELOPER_CERTIFICATE_AUTHORITY_PATH="$RUNNER_TEMP/apple-developer-certificate-authority.cer"
KEYCHAIN_PATH="$RUNNER_TEMP/apple-developer.keychain-db"
echo -n "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE" | base64 --decode -i - -o "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH"
echo -n "$APPLE_DEVELOPER_CERTIFICATE_AUTHORITY" | base64 --decode -i - -o "$APPLE_DEVELOPER_CERTIFICATE_AUTHORITY_PATH"
security create-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security import "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH" -P "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security import "$APPLE_DEVELOPER_CERTIFICATE_AUTHORITY_PATH" -P "$APPLE_DEVELOPER_CERTIFICATE_PASSWORD" -A -t cert -f pkcs7 -k "$KEYCHAIN_PATH"
security list-keychain -d user -s "$KEYCHAIN_PATH"
- name: Build mist
run: swift build --configuration release --arch arm64 --arch x86_64
- name: Codesign mist
run: |
KEYCHAIN_PATH="$RUNNER_TEMP/apple-developer.keychain-db"
SIGNING_IDENTITY="Developer ID Application: Nindi Gill (7K3HVCLV7Z)"
codesign --keychain "$KEYCHAIN_PATH" --sign "$SIGNING_IDENTITY" --options runtime ".build/apple/Products/release/mist"
- name: Add mist to $PATH
run: echo "$GITHUB_WORKSPACE/.build/apple/Products/release" >> $GITHUB_PATH
- name: Print mist version
run: mist --version
- name: Print mist list for Firmwares
run: mist list firmware
- name: Print mist list for Installers
run: mist list installer
- name: Remove Apple Developer Keychain
if: ${{ always() }}
run: security delete-keychain $RUNNER_TEMP/apple-developer.keychain-db