Repository navigation
93 lines (82 loc) · 2.87 KB
/
Copy pathrelease.yml
File metadata and controls
93 lines (82 loc) · 2.87 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Signed Release
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: macos-latest
env:
APP_NAME: Overlook
BUNDLE_ID: com.rcawston.Overlook
steps:
- uses: actions/checkout@v4
- name: Import Developer ID certificate
uses: apple-actions/import-codesign-certs@v7
with:
p12-file-base64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
p12-password: ${{ secrets.P12_PASSWORD }}
- name: Write notary API key
env:
API_KEY: ${{ secrets.APPLE_API_KEY_BASE64 }}
run: |
echo -n "$API_KEY" | base64 --decode > "$RUNNER_TEMP/AuthKey.p8"
chmod 600 "$RUNNER_TEMP/AuthKey.p8"
- name: Point ExportOptions at this team
env:
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: /usr/libexec/PlistBuddy -c "Set :teamID $TEAM_ID" ExportOptions.plist
- name: Archive
env:
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
set -euo pipefail
xcodebuild archive \
-project Overlook.xcodeproj \
-scheme Overlook \
-configuration Release \
-destination "generic/platform=macOS" \
-archivePath "$RUNNER_TEMP/Overlook.xcarchive" \
DEVELOPMENT_TEAM="$TEAM_ID" \
PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
CODE_SIGN_STYLE=Manual \
CODE_SIGN_IDENTITY="Developer ID Application" \
CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO \
OTHER_CODE_SIGN_FLAGS="--timestamp"
- name: Export Developer ID app
run: |
xcodebuild -exportArchive \
-archivePath "$RUNNER_TEMP/Overlook.xcarchive" \
-exportPath "$RUNNER_TEMP/export" \
-exportOptionsPlist ExportOptions.plist
- name: Notarize and staple
env:
KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
ISSUER: ${{ secrets.APPLE_API_ISSUER_ID }}
run: |
set -euo pipefail
APP="$RUNNER_TEMP/export/${APP_NAME}.app"
ZIP="$RUNNER_TEMP/${APP_NAME}.zip"
ditto -c -k --keepParent "$APP" "$ZIP"
xcrun notarytool submit "$ZIP" \
--key "$RUNNER_TEMP/AuthKey.p8" \
--key-id "$KEY_ID" \
--issuer "$ISSUER" \
--wait
xcrun stapler staple "$APP"
codesign -dv --verbose=4 "$APP"
spctl --assess --verbose=4 --type execute "$APP"
ditto -c -k --keepParent "$APP" "$GITHUB_WORKSPACE/${APP_NAME}.zip"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Overlook-signed
path: Overlook.zip
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: Overlook.zip
generate_release_notes: true