Skip to content

Commit

Permalink
devops: add publish to npm pipeline #3
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Jan 30, 2024
1 parent b55985e commit 21705c5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will publish a package to npm when a release is published
# For more information, see https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 'latest'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build:lib
# scoped packages are private by default so need to add public flag
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ dist-ssr
build/
coverage/
docs/
storybook-static/
storybook-static/


.env
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "dad-ui-components-starter-template",
"name": "@maany_shr/dad-ui-components-starter-template",
"version": "0.0.0",
"author": "Mayank Sharma <imptodefeat@gmail.com>",
"private": false,
"version": "0.0.1",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 21705c5

Please sign in to comment.