Refactor cicd (#397)

* Refactor cicd

* Correct version plugin core

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
This commit is contained in:
hiento09 2023-10-19 15:29:40 +07:00 committed by GitHub
parent a9654acc4a
commit a6694921e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 84 additions and 133 deletions

View File

@ -1,29 +0,0 @@
name: Jan Docs Test Build
on:
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/deploy-jan-docs.yml'
- '.github/workflows/jan-docs-test.yml'
jobs:
deploy:
name: Test Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: './docs/yarn.lock'
- name: Install dependencies
run: yarn install
working-directory: docs
- name: Test Build Command
run: sed -i '/process.env.DEBUG = namespaces;/c\// process.env.DEBUG = namespaces;' ./node_modules/debug/src/node.js && yarn build
working-directory: docs

View File

@ -1,4 +1,4 @@
name: Deploy to GitHub Pages
name: Jan Docs
on:
push:
@ -6,7 +6,13 @@ on:
- main
paths:
- 'docs/**'
- '.github/workflows/deploy-jan-docs.yml'
- '.github/workflows/jan-docs.yml'
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/jan-docs.yml'
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
@ -30,11 +36,13 @@ jobs:
working-directory: docs
- name: Add Custome Domain file
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
run: echo "${{ vars.DOCUSAURUS_DOMAIN }}" > ./docs/build/CNAME
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,4 +1,4 @@
name: Jan Build MacOS App
name: Jan Build Electron App
on:
push:

View File

@ -1,11 +1,11 @@
name: Linter & Test
name: Jan Electron Linter & Test
on:
push:
branches:
- main
paths:
- 'electron/**'
- .github/workflows/linter-and-test.yml
- .github/workflows/jan-electron-linter-and-test.yml
- 'web/**'
- 'package.json'
- 'node_modules/**'

View File

@ -1,11 +1,18 @@
name: Publish plugin core Package to npmjs
name: Plugin Core
on:
push:
branches:
- main
paths:
- "core/**"
- ".github/workflows/publish-core.yml"
- ".github/workflows/jan-plugin-core.yml"
- "!core/package.json"
pull_request:
branches:
- main
paths:
- "core/**"
- ".github/workflows/jan-plugin-core.yml"
- "!core/package.json"
jobs:
build-and-publish-plugins:
@ -50,11 +57,13 @@ jobs:
- run: npm install && npm run build
working-directory: ./core
- run: npm publish --access public
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ./core
- name: "Commit new version to main and create tag"
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
run: |
version=$(jq -r '.version' core/package.json)
git config --global user.email "service@jan.ai"

View File

@ -1,11 +1,18 @@
name: Publish plugins/$dir Package to npmjs
name: Jan Default Plugins
on:
push:
branches:
- main
paths:
- "plugins/**"
- ".github/workflows/publish-plugins.yml"
- ".github/workflows/jan-plugins.yml"
- "!plugins/*/package.json"
pull_request:
branches:
- main
paths:
- "plugins/**"
- ".github/workflows/jan-plugins.yml"
- "!plugins/*/package.json"
jobs:
build:
@ -69,13 +76,16 @@ jobs:
echo $dir
cd $dir
npm install && npm run build
if [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME != $GITHUB_REPOSITORY ]]; then
npm publish --access public
fi
cd ..
done
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: "Commit new version to main and create tag"
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
run: |
for dir in $(cat /tmp/change_dir.txt)
do

View File

@ -1,39 +0,0 @@
name: Linter & Sonarqube scanner
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-lint:
runs-on: ubuntu-latest
steps:
- name: Getting the repo
uses: actions/checkout@v2
- name: create sonar properties file
run: |
echo "Branch Name ${GITHUB_REF#refs/heads/}"
echo -e "sonar.sources = ." > sonar-project.properties
echo -e "sonar.projectKey = ${{ secrets.PROJECT_KEY }}" >> sonar-project.properties
if [[ "${{ github.event_name }}" == "push" ]]; then
echo -e "sonar.branch.name = ${GITHUB_REF#refs/heads/}" >> sonar-project.properties
fi
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# Check the Quality Gate status.
- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
# Force to fail step after specific time.
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL

View File

@ -1,12 +1,12 @@
{
"name": "@janhq/data-plugin",
"version": "1.0.1",
"version": "1.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@janhq/data-plugin",
"version": "1.0.1",
"version": "1.0.3",
"bundleDependencies": [
"pouchdb-node",
"pouchdb-find"
@ -14,7 +14,7 @@
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"pouchdb-find": "^8.0.1",
"pouchdb-node": "^8.0.1"
},
@ -51,9 +51,9 @@
}
},
"node_modules/@janhq/core": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.1.tgz",
"integrity": "sha512-p6T+7gc7Bfwmef9Y+whdHxWAwdvcJ3psyni/sKgraLV4kuVIiGZuhcIrah/3PtTB2Jcoo5Sl4Cp51PC50xY2Tg=="
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.3.tgz",
"integrity": "sha512-MZhNp6dPqd7pZaou81c+BBH5CXnyh9ZF2GH5ri+JNHiMs+LaZd1GlxQBzseWnaoVZWghOUI1hf8GxlrCdLb7ew=="
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",

View File

@ -40,7 +40,7 @@
"node_modules"
],
"dependencies": {
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"pouchdb-find": "^8.0.1",
"pouchdb-node": "^8.0.1"
}

View File

@ -1,12 +1,12 @@
{
"name": "@janhq/inference-plugin",
"version": "1.0.1",
"version": "1.0.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@janhq/inference-plugin",
"version": "1.0.1",
"version": "1.0.4",
"bundleDependencies": [
"tcp-port-used",
"kill-port-process"
@ -14,8 +14,9 @@
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"kill-port-process": "^3.2.0",
"rxjs": "^7.8.1",
"tcp-port-used": "^1.0.2",
"ts-loader": "^9.5.0"
},
@ -39,9 +40,9 @@
}
},
"node_modules/@janhq/core": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.1.tgz",
"integrity": "sha512-p6T+7gc7Bfwmef9Y+whdHxWAwdvcJ3psyni/sKgraLV4kuVIiGZuhcIrah/3PtTB2Jcoo5Sl4Cp51PC50xY2Tg=="
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.3.tgz",
"integrity": "sha512-MZhNp6dPqd7pZaou81c+BBH5CXnyh9ZF2GH5ri+JNHiMs+LaZd1GlxQBzseWnaoVZWghOUI1hf8GxlrCdLb7ew=="
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",
@ -3026,6 +3027,14 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rxjs": {
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -3725,6 +3734,11 @@
"node": ">=8.0"
}
},
"node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/typescript": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",

View File

@ -26,7 +26,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "^0.1.2",
"@janhq/core": "^0.1.3",
"kill-port-process": "^3.2.0",
"rxjs": "^7.8.1",
"tcp-port-used": "^1.0.2",

View File

@ -1,20 +1,16 @@
{
"name": "@janhq/model-management-plugin",
"version": "1.0.1",
"version": "1.0.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@janhq/model-management-plugin",
"version": "1.0.1",
"bundleDependencies": [
"@huggingface/hub"
],
"version": "1.0.4",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@huggingface/hub": "^0.8.5",
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"ts-loader": "^9.5.0"
},
"devDependencies": {
@ -33,22 +29,10 @@
"node": ">=10.0.0"
}
},
"node_modules/@huggingface/hub": {
"version": "0.8.6",
"resolved": "https://registry.npmjs.org/@huggingface/hub/-/hub-0.8.6.tgz",
"integrity": "sha512-V2f1+BiBd3PIRYkEjvjrqJuCWqZQniaHMYcNvwB+PcubvEECkmgBt3tvXMpNUK4M27YK1RjflQbCVXSZMuQeow==",
"inBundle": true,
"dependencies": {
"hash-wasm": "^4.9.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@janhq/core": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.1.tgz",
"integrity": "sha512-p6T+7gc7Bfwmef9Y+whdHxWAwdvcJ3psyni/sKgraLV4kuVIiGZuhcIrah/3PtTB2Jcoo5Sl4Cp51PC50xY2Tg=="
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.3.tgz",
"integrity": "sha512-MZhNp6dPqd7pZaou81c+BBH5CXnyh9ZF2GH5ri+JNHiMs+LaZd1GlxQBzseWnaoVZWghOUI1hf8GxlrCdLb7ew=="
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",
@ -1397,12 +1381,6 @@
"node": ">=0.10.0"
}
},
"node_modules/hash-wasm": {
"version": "4.9.0",
"resolved": "https://registry.npmjs.org/hash-wasm/-/hash-wasm-4.9.0.tgz",
"integrity": "sha512-7SW7ejyfnRxuOc7ptQHSf4LDoZaWOivfzqw+5rpcQku0nHfmicPKE51ra9BiRLAmT8+gGLestr1XroUkqdjL6w==",
"inBundle": true
},
"node_modules/import-local": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz",

View File

@ -27,7 +27,7 @@
"README.md"
],
"dependencies": {
"@janhq/core": "^0.1.2",
"@janhq/core": "^0.1.3",
"ts-loader": "^9.5.0"
}
}

View File

@ -1,19 +1,19 @@
{
"name": "@janhq/monitoring-plugin",
"version": "1.0.1",
"version": "1.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@janhq/monitoring-plugin",
"version": "1.0.1",
"version": "1.0.3",
"bundleDependencies": [
"systeminformation"
],
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"systeminformation": "^5.21.8",
"ts-loader": "^9.5.0"
},
@ -33,9 +33,9 @@
}
},
"node_modules/@janhq/core": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.1.tgz",
"integrity": "sha512-p6T+7gc7Bfwmef9Y+whdHxWAwdvcJ3psyni/sKgraLV4kuVIiGZuhcIrah/3PtTB2Jcoo5Sl4Cp51PC50xY2Tg=="
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@janhq/core/-/core-0.1.3.tgz",
"integrity": "sha512-MZhNp6dPqd7pZaou81c+BBH5CXnyh9ZF2GH5ri+JNHiMs+LaZd1GlxQBzseWnaoVZWghOUI1hf8GxlrCdLb7ew=="
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",

View File

@ -21,7 +21,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"systeminformation": "^5.21.8",
"ts-loader": "^9.5.0"
},

View File

@ -26,7 +26,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "^0.1.1",
"@janhq/core": "^0.1.3",
"azure-openai": "^0.9.4",
"kill-port-process": "^3.2.0",
"tcp-port-used": "^1.0.2",

View File

@ -194,10 +194,10 @@
resolved "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz"
integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==
"@janhq/plugin-core@^0.1.8":
version "0.1.8"
resolved "https://registry.yarnpkg.com/@janhq/plugin-core/-/plugin-core-0.1.8.tgz#abd61ce05831ee03f16be1f4d18512cfb22ebb4e"
integrity sha512-wJe+8ndMQLGLSV36Jt1V3s5lmH+nQw87ol2NMhHuVWXfwf+DAO1GTdTeHfemHWdcB/oUY1HVRvsNh8DvBgbh/w==
"@janhq/core@^0.1.2":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@janhq/core/-/core-0.1.3.tgz#9315bc19c692183e64ada17b85276c629df91eb4"
integrity sha512-MZhNp6dPqd7pZaou81c+BBH5CXnyh9ZF2GH5ri+JNHiMs+LaZd1GlxQBzseWnaoVZWghOUI1hf8GxlrCdLb7ew==
"@jridgewell/gen-mapping@^0.3.2":
version "0.3.3"