Skip to content

fix: ad-hoc sign macOS binaries to prevent Gatekeeper "damaged" error #4

fix: ad-hoc sign macOS binaries to prevent Gatekeeper "damaged" error

fix: ad-hoc sign macOS binaries to prevent Gatekeeper "damaged" error #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.19.0
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build extension zips
run: pnpm --filter @browser-cli/extension build
- name: Collect extension zips
run: |
mkdir -p extension-zips
cp apps/extension/.output/*.zip extension-zips/
- name: Upload extension artifacts
uses: actions/upload-artifact@v4
with:
name: extension-zips
path: extension-zips/
build-cli-binaries:
strategy:
matrix:
include:
- target: bun-linux-x64
outfile: browser-cli-linux-x64
os: ubuntu-latest
- target: bun-linux-arm64
outfile: browser-cli-linux-arm64
os: ubuntu-latest
- target: bun-darwin-x64
outfile: browser-cli-darwin-x64
os: macos-latest
- target: bun-darwin-arm64
outfile: browser-cli-darwin-arm64
os: macos-latest
- target: bun-windows-x64
outfile: browser-cli-windows-x64.exe
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.19.0
cache: pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build binary (${{ matrix.target }})
working-directory: apps/cli
run: bun run ./build-binary.ts --target ${{ matrix.target }} --outfile ./dist/${{ matrix.outfile }}
- name: Ad-hoc sign macOS binary
if: startsWith(matrix.target, 'bun-darwin')
run: codesign --force --sign - apps/cli/dist/${{ matrix.outfile }}
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.outfile }}
path: apps/cli/dist/${{ matrix.outfile }}
release:
runs-on: ubuntu-latest
needs: [build-extension, build-cli-binaries]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f | sort
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/extension-zips/*.zip
artifacts/browser-cli-*/*
generate_release_notes: true
fail_on_unmatched_files: true