Skip to content

Commit

Permalink
Merge pull request #3 from janhq/feat/cicd
Browse files Browse the repository at this point in the history
Feat cicd cortex-node
  • Loading branch information
hiento09 committed May 28, 2024
2 parents ad978f7 + 9b44ced commit d6a4c87
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/cortex-node-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish cortex js Package to npmjs
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]

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: |
# Remove the v prefix
new_version=${GITHUB_REF#refs/tags/v}
# 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
- run: bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit d6a4c87

Please sign in to comment.