Skip to content

Commit

Permalink
Add CI for cortex js
Browse files Browse the repository at this point in the history
  • Loading branch information
hientominh committed May 16, 2024
1 parent e4b1f96 commit 33a0e96
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 22 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/cortex-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish cortex js Package to npmjs
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+-cortex-js"]
paths:
[
"cortex-js/**",
]
jobs:
build-and-publish-plugins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"

- name: Install jq
uses: dcarbone/[email protected]

- name: "Update version by tag"
run: |
cd cortex-js
# Remove the v prefix
tag_version=${GITHUB_REF#refs/tags/v}
# Remove the -cortex-js suffix
new_version=${tag_version%-cortex-js}
# Replace the old version with the new version in package.json
jq --arg version "$new_version" '.version = $version' ./package.json > /tmp/package.json && mv /tmp/package.json ./package.json
# Print the new version
echo "Updated package.json version to: $new_version"
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: yarn install && yarn build
working-directory: ./cortex-js
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ./cortex-js
2 changes: 1 addition & 1 deletion cortex-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cortex-js",
"name": "@janhq/cortex",
"version": "0.0.1",
"description": "",
"author": "",
Expand Down
21 changes: 0 additions & 21 deletions package.json

This file was deleted.

0 comments on commit 33a0e96

Please sign in to comment.