Skip to content

Commit ec1bf4c

Browse files
committed
Add code signing to release action
1 parent 0da9132 commit ec1bf4c

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,41 @@ jobs:
5757
--define "CLI_VERSION='$VERSION'" \
5858
src/index.ts --outfile=./bin/linear-release
5959
60+
- name: Import code signing certificate
61+
if: matrix.os == 'macos-latest'
62+
env:
63+
CSC_LINK: ${{ secrets.CSC_LINK }}
64+
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
65+
run: |
66+
echo "$CSC_LINK" | base64 --decode > certificate.p12
67+
security create-keychain -p "" build.keychain
68+
security default-keychain -s build.keychain
69+
security unlock-keychain -p "" build.keychain
70+
security import certificate.p12 -k build.keychain -P "$CSC_KEY_PASSWORD" -T /usr/bin/codesign
71+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain
72+
rm certificate.p12
73+
6074
- name: Code sign macOS executable
6175
if: matrix.os == 'macos-latest'
6276
run: |
63-
codesign --force --deep --sign - ./bin/linear-release || true
77+
codesign --entitlements entitlements.mac.plist --force --options runtime \
78+
--sign "Developer ID Application: Linear Orbit, Inc. (${{ secrets.APPLE_TEAM_ID }})" ./bin/linear-release
79+
codesign --verify --verbose ./bin/linear-release
80+
81+
- name: Notarize macOS executable
82+
if: matrix.os == 'macos-latest'
83+
env:
84+
APPLE_ID: ${{ secrets.APPLE_ID }}
85+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
86+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
87+
run: |
88+
ditto -c -k --keepParent ./bin/linear-release ./bin/linear-release.zip
89+
xcrun notarytool submit ./bin/linear-release.zip \
90+
--apple-id "$APPLE_ID" \
91+
--team-id "$APPLE_TEAM_ID" \
92+
--password "$APPLE_APP_SPECIFIC_PASSWORD" \
93+
--wait
94+
rm ./bin/linear-release.zip
6495
6596
- name: Upload artifact
6697
uses: actions/upload-artifact@v4

entitlements.mac.plist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-jit</key>
6+
<true/>
7+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
8+
<true/>
9+
<key>com.apple.security.cs.disable-executable-page-protection</key>
10+
<true/>
11+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
12+
<true/>
13+
<key>com.apple.security.cs.disable-library-validation</key>
14+
<true/>
15+
</dict>
16+
</plist>

0 commit comments

Comments
 (0)