Skip to content

Commit

Permalink
chore: add MacOS pkg installer
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Jun 25, 2024
1 parent edd3d8d commit 28ab1bf
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/cortex-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI Cortex Release

on:
push:
branches:
- chore/cortex-pkg-installer
workflow_dispatch:

jobs:
build-cortex-single-binary:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "amd64"
runs-on: "ubuntu-latest"

- os: "mac"
name: "amd64"
runs-on: "macos-13"

- os: "mac"
name: "arm64"
runs-on: "macos-latest"
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-dotnet@v3
if: runner.os == 'Windows'
with:
dotnet-version: "8.0.x"

- name: Install jq
uses: dcarbone/[email protected]

- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- run: yarn install && yarn build && yarn build:binary
working-directory: ./cortex-js

- name: Get Cer for code signing
if: runner.os == 'macOS'
run: base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12
shell: bash
env:
CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }}

- uses: apple-actions/import-codesign-certs@v2
if: runner.os == 'macOS'
with:
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}

- name: Create pkg installer
if: runner.os == 'macOS'
run: |
cd cortex-js
mkdir installer
cp cortex installer/cortex
pkgbuild --identifier ai.cortex.pkg --install-location ./usr/local/bin/ --root ./installer cortex-installer.pkg
- name: Code Signing macOS
if: runner.os == 'macOS'
run: |
cd cortex-js
make codesign CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
- name: Post-Bundle
run: |
cd cortex-js
make postbundle
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: cortex-${{ matrix.os }}-${{ matrix.name }}
path: |
./cortex-js/cortex
./cortex-js/cortex.exe
./cortex-js/setup.exe
./cortex-js/cortex-installer.pkg
1 change: 1 addition & 0 deletions cortex-js/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ else ifeq ($(shell uname -s),Linux)
@exit 0
else
find "cortex" -type f -exec codesign --force -s "$(DEVELOPER_ID)" --options=runtime {} \;
find "cortex-installer.pkg" -type f -exec codesign --force -s "$(DEVELOPER_ID)" --options=runtime {} \;
endif

0 comments on commit 28ab1bf

Please sign in to comment.