Skip to content

Commit 6627965

Browse files
committed
fix(quoteforge[dist]): use rcodesign for darwin binaries on all hosts
1 parent f6848cc commit 6627965

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ jobs:
4949
- name: Install deps
5050
run: bun install --frozen-lockfile
5151

52+
- name: Install rcodesign (darwin signing)
53+
if: startsWith(matrix.bun-target, 'bun-darwin-')
54+
shell: bash
55+
env:
56+
RCODESIGN_VERSION: "0.29.0"
57+
run: |
58+
set -e
59+
case "$(uname -sm)" in
60+
"Darwin arm64") asset="aarch64-apple-darwin" ;;
61+
"Darwin x86_64") asset="x86_64-apple-darwin" ;;
62+
"Linux x86_64") asset="x86_64-unknown-linux-musl" ;;
63+
*) echo "unsupported host for rcodesign"; exit 1 ;;
64+
esac
65+
url="https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign/${RCODESIGN_VERSION}/apple-codesign-${RCODESIGN_VERSION}-${asset}.tar.gz"
66+
curl -fsSL "$url" | tar -xz
67+
sudo mv "apple-codesign-${RCODESIGN_VERSION}-${asset}/rcodesign" /usr/local/bin/rcodesign
68+
rcodesign --version
69+
5270
- name: Build binary
5371
shell: bash
5472
env:

scripts/build-binaries.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ async function sha256(file: string): Promise<string> {
3535
}
3636

3737
async function adhocSignDarwin(binPath: string): Promise<void> {
38-
if (process.platform !== "darwin") {
39-
throw new Error("Darwin binaries must be ad-hoc signed on macOS with codesign.");
40-
}
41-
await $`codesign --sign - --force ${binPath}`;
38+
await $`rcodesign sign ${binPath}`;
4239
}
4340

4441
async function tarGz(binPath: string, archivePath: string, binName: string): Promise<void> {

0 commit comments

Comments
 (0)