-
Notifications
You must be signed in to change notification settings - Fork 135
106 lines (89 loc) · 2.81 KB
/
cortex-build-test.yml
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
94
95
96
97
98
99
100
101
102
103
104
105
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
- name: Upload Windows Installer
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: cortex-installer-${{ matrix.os }}-${{ matrix.name }}
path: |
./cortex-js/setup.exe
- name: Upload MacOS Installer
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
with:
name: cortex-installer-${{ matrix.os }}-${{ matrix.name }}
path: |
./cortex-js/cortex-installer.pkg