Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit fbf8acf

Browse files
committed
chore: test
1 parent 6c98e04 commit fbf8acf

File tree

2 files changed

+105
-11
lines changed

2 files changed

+105
-11
lines changed

.github/workflows/cortex-js.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,12 @@ jobs:
1818
uses: dcarbone/[email protected]
1919

2020
- name: "Update version by tag"
21+
shell: bash
2122
run: |
22-
cd cortex-js
23-
# Remove the v prefix
24-
tag_version=${GITHUB_REF#refs/tags/v}
25-
# Remove the -cortex-js suffix
26-
new_version=${tag_version%-cortex-js}
27-
28-
# Replace the old version with the new version in package.json
29-
jq --arg version "$new_version" '.version = $version' ./package.json > /tmp/package.json && mv /tmp/package.json ./package.json
30-
31-
# Print the new version
32-
echo "Updated package.json version to: $new_version"
23+
echo "Version: ${{ inputs.new_version }}"
24+
# Update the version in package.json
25+
jq --arg version "${{ inputs.new_version }}" '.version = $version' package.json > /tmp/package.json
26+
mv /tmp/package.json package.json
3327
3428
# Setup .npmrc file to publish to npm
3529
- uses: actions/setup-node@v3
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
uses: dcarbone/[email protected]
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

Comments
 (0)