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

Commit 35d1a47

Browse files
committed
Merge branch 'dev' of github.com:janhq/nitro into feat/cpuid
2 parents 94e77ac + bd4d5de commit 35d1a47

File tree

90 files changed

+2727
-1152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2727
-1152
lines changed

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Describe Your Changes
2+
3+
-
4+
5+
## Fixes Issues
6+
7+
- Closes #
8+
- Closes #
9+
10+
## Self Checklist
11+
12+
- [ ] Added relevant comments, esp in complex areas
13+
- [ ] Updated docs (for bug fixes / features)
14+
- [ ] Created issues for follow-up changes or refactoring needed

.github/workflows/build.yml renamed to .github/workflows/cortex-cpp-build.yml

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI Cortex CPP
22

33
on:
44
push:
@@ -25,17 +25,17 @@ jobs:
2525
steps:
2626
- name: Extract tag name without v prefix
2727
id: get_version
28-
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
28+
run: |
29+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
2930
env:
3031
GITHUB_REF: ${{ github.ref }}
3132
- name: Create Draft Release
3233
id: create_release
33-
uses: actions/create-release@v1
34-
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
uses: softprops/action-gh-release@v2
3635
with:
3736
tag_name: ${{ github.ref_name }}
38-
release_name: "${{ env.VERSION }}"
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
name: "${{ env.VERSION }}"
3939
draft: true
4040
prerelease: false
4141

@@ -91,7 +91,7 @@ jobs:
9191

9292
- os: "mac"
9393
name: "arm64"
94-
runs-on: "mac-silicon"
94+
runs-on: "macos-latest"
9595
cmake-flags: "-DMAC_ARM64=ON"
9696
run-e2e: true
9797

@@ -161,16 +161,54 @@ jobs:
161161
with:
162162
submodules: recursive
163163

164+
- uses: actions/setup-dotnet@v3
165+
if: runner.os == 'Windows'
166+
with:
167+
dotnet-version: "8.0.x"
168+
164169
- name: Install choco on Windows
165170
if: runner.os == 'Windows'
166171
run: |
167172
choco install make -y
168173
174+
- name: Get Cer for code signing
175+
if: runner.os == 'macOS'
176+
run: base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12
177+
shell: bash
178+
env:
179+
CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
180+
181+
- uses: apple-actions/import-codesign-certs@v2
182+
if: runner.os == 'macOS'
183+
with:
184+
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
185+
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}
186+
169187
- name: Build
170188
run: |
171189
cd cortex-cpp
172190
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}"
173191
192+
- name: Pre-package
193+
run: |
194+
cd cortex-cpp
195+
make pre-package
196+
197+
- name: Code Signing macOS
198+
if: runner.os == 'macOS'
199+
run: |
200+
cd cortex-cpp
201+
make codesign CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
202+
203+
- name: Code Signing Windows
204+
if: runner.os == 'Windows'
205+
shell: cmd
206+
run: |
207+
cd cortex-cpp
208+
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
209+
make codesign CODE_SIGN=true AZURE_KEY_VAULT_URI="${{ secrets.AZURE_KEY_VAULT_URI }}" AZURE_CLIENT_ID="${{ secrets.AZURE_CLIENT_ID }}" AZURE_TENANT_ID="${{ secrets.AZURE_TENANT_ID }}" AZURE_CLIENT_SECRET="${{ secrets.AZURE_CLIENT_SECRET }}" AZURE_CERT_NAME="${{ secrets.AZURE_CERT_NAME }}"
210+
211+
174212
- name: Package
175213
run: |
176214
cd cortex-cpp
@@ -196,4 +234,28 @@ jobs:
196234
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
197235
asset_path: ./cortex-cpp/cortex-cpp.tar.gz
198236
asset_name: cortex-cpp-${{ needs.create-draft-release.outputs.version }}-${{ matrix.os }}-${{ matrix.name }}.tar.gz
199-
asset_content_type: application/gzip
237+
asset_content_type: application/gzip
238+
239+
update_release_draft:
240+
needs: [build-and-test]
241+
permissions:
242+
# write permission is required to create a github release
243+
contents: write
244+
# write permission is required for autolabeler
245+
# otherwise, read permission is required at least
246+
pull-requests: write
247+
runs-on: ubuntu-latest
248+
steps:
249+
# (Optional) GitHub Enterprise requires GHE_HOST variable set
250+
#- name: Set GHE_HOST
251+
# run: |
252+
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
253+
254+
# Drafts your next Release notes as Pull Requests are merged into "master"
255+
- uses: release-drafter/release-drafter@v5
256+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
257+
# with:
258+
# config-name: my-config.yml
259+
# disable-autolabeler: true
260+
env:
261+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/quality-gate.yml renamed to .github/workflows/cortex-cpp-quality-gate.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI Quality Gate
1+
name: CI Quality Gate Cortex CPP
22

33
on:
44
pull_request:
@@ -145,6 +145,11 @@ jobs:
145145
cd cortex-cpp
146146
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}"
147147
148+
- name: Pre-package
149+
run: |
150+
cd cortex-cpp
151+
make pre-package
152+
148153
- name: Package
149154
run: |
150155
cd cortex-cpp

.github/workflows/cortex-js.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish cortex js Package to npmjs
2+
on:
3+
push:
4+
tags: ["v[0-9]+.[0-9]+.[0-9]+-cortex-js"]
5+
paths:
6+
[
7+
"cortex-js/**",
8+
]
9+
jobs:
10+
build-and-publish-plugins:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: "0"
16+
17+
- name: Install jq
18+
uses: dcarbone/install-jq-action@v2.0.1
19+
20+
- name: "Update version by tag"
21+
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"
33+
34+
# Setup .npmrc file to publish to npm
35+
- uses: actions/setup-node@v3
36+
with:
37+
node-version: "20.x"
38+
registry-url: "https://registry.npmjs.org"
39+
- run: yarn install && yarn build
40+
working-directory: ./cortex-js
41+
- run: npm publish --access public
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
working-directory: ./cortex-js

0 commit comments

Comments
 (0)