Skip to content

Commit 654bfbd

Browse files
authored
Update main.yml
Update: gha workflow with npm publish step
1 parent 2a35d58 commit 654bfbd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,17 @@ jobs:
1919
-w "/app" \
2020
-v $PWD:/app \
2121
node:8 bash -c "npm i --no-save -q; npm run build; npm run coverage -- --reporter mocha-junit-reporter; chown -R $(id -u):$(id -g) ."
22-
22+
- name: Setup .npmrc
23+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
24+
env:
25+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26+
- name: Build, Version, and Publish to npm using Docker
27+
env:
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
NPM_VERSION: '1.0.0'
30+
run: |
31+
docker run --rm \
32+
-w "/app" \
33+
-v $PWD:/app \
34+
-v ${{ github.workspace }}/.npmrc:/root/.npmrc \
35+
node:16 bash -c "npm i --no-save -q; npm run build; npm version ${NPM_VERSION} > version.txt; npm publish --tag dev; chown -R $(id -u):$(id -g) ."

0 commit comments

Comments
 (0)