Commit 71652f5 1 parent ad978f7 commit 71652f5 Copy full SHA for 71652f5
File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish cortex js Package to npmjs
2
+ on :
3
+ push :
4
+ tags : ["v[0-9]+.[0-9]+.[0-9]+"]
5
+
6
+ jobs :
7
+ build-and-publish-plugins :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v4
11
+ with :
12
+ fetch-depth : " 0"
13
+
14
+ - name : Install jq
15
+ uses : dcarbone/install-jq-action@v2.0.1
16
+
17
+ - name : " Update version by tag"
18
+ run : |
19
+ # Remove the v prefix
20
+ new_version=${GITHUB_REF#refs/tags/v}
21
+
22
+ # Replace the old version with the new version in package.json
23
+ jq --arg version "$new_version" '.version = $version' ./package.json > /tmp/package.json && mv /tmp/package.json ./package.json
24
+
25
+ # Print the new version
26
+ echo "Updated package.json version to: $new_version"
27
+
28
+ # Setup .npmrc file to publish to npm
29
+ - uses : actions/setup-node@v3
30
+ with :
31
+ node-version : " 20.x"
32
+ registry-url : " https://registry.npmjs.org"
33
+ - run : yarn install && yarn build
34
+ - run : bash ./bin/publish-npm
35
+ env :
36
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments