1+ name : CI Cortex
2+
3+ on :
4+ push :
5+ branches :
6+ - chore/test-ci-with-versioning
7+ workflow_dispatch :
8+ jobs :
9+ build-cortex-single-binary :
10+ runs-on : ${{ matrix.runs-on }}
11+ timeout-minutes : 20
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ include :
16+ - os : " linux"
17+ name : " amd64"
18+ runs-on : " ubuntu-latest"
19+
20+ - os : " windows"
21+ name : " amd64"
22+ runs-on : " windows-2019"
23+
24+ - os : " mac"
25+ name : " amd64"
26+ runs-on : " macos-13"
27+
28+ - os : " mac"
29+ name : " arm64"
30+ runs-on : " macos-latest"
31+ steps :
32+ - name : Clone
33+ id : checkout
34+ uses : actions/checkout@v3
35+ with :
36+ submodules : recursive
37+
38+ - name : Install jq
39+ 40+
41+ - name : " Update version by tag"
42+ shell : bash
43+ run : |
44+ echo "Version: ${{ inputs.new_version }}"
45+ # Update the version in package.json
46+ jq --arg version "${{ inputs.new_version }}" '.version = $version' package.json > /tmp/package.json
47+ mv /tmp/package.json package.json
48+
49+ - uses : actions/setup-dotnet@v3
50+ if : runner.os == 'Windows'
51+ with :
52+ dotnet-version : " 8.0.x"
53+
54+ - name : Install choco on Windows
55+ if : runner.os == 'Windows'
56+ run : |
57+ choco install make -y
58+
59+ - uses : actions/setup-node@v3
60+ with :
61+ node-version : " 20.x"
62+ registry-url : " https://registry.npmjs.org"
63+
64+ - run : npm install -g yarn
65+
66+ - run : yarn install && yarn build && yarn build:binary
67+ working-directory : ./cortex-js
68+
69+ - name : Get Cer for code signing
70+ if : runner.os == 'macOS'
71+ run : base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12
72+ shell : bash
73+ env :
74+ CODE_SIGN_P12_BASE64 : ${{ secrets.CODE_SIGN_P12_BASE64 }}
75+
76+ - uses : apple-actions/import-codesign-certs@v2
77+ if : runner.os == 'macOS'
78+ with :
79+ p12-file-base64 : ${{ secrets.CODE_SIGN_P12_BASE64 }}
80+ p12-password : ${{ secrets.CODE_SIGN_P12_PASSWORD }}
81+
82+ - name : Code Signing macOS
83+ if : runner.os == 'macOS'
84+ run : |
85+ cd cortex-js
86+ make codesign CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
87+
88+ - name : Post-Bundle
89+ run : |
90+ cd cortex-js
91+ make postbundle
92+
93+ - name : Upload Artifact
94+ uses : actions/upload-artifact@v2
95+ with :
96+ name : cortex-${{ matrix.os }}-${{ matrix.name }}
97+ path : |
98+ ./cortex-js/cortex
99+ ./cortex-js/cortex.exe
100+ ./cortex-js/setup.exe
0 commit comments