Skip to content

Commit

Permalink
Merge pull request #51 from berkandirim/master
Browse files Browse the repository at this point in the history
Add CI to publlish to NPM
  • Loading branch information
berkandirim authored Apr 19, 2024
2 parents 55bea0e + 263edb6 commit 6eb198a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .ci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -eu

echo "Publishing release $TAG"

echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > ~/.npmrc
npm run publish
7 changes: 4 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
- env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm ci
bash .ci/publish.sh
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"build": "babel src/templating --out-dir lib",
"lint": "eslint index.js src/**/*.js",
"lint:fix": "npm run lint -- --fix",
"watch": "nodemon --watch src --exec 'npm run lint && npm run build'"
"watch": "nodemon --watch src --exec 'npm run lint && npm run build'",
"publish": "npm publish --access public"
},
"preferGlobal": true,
"bin": {
Expand Down

0 comments on commit 6eb198a

Please sign in to comment.