Skip to content

Merge branch 'main' into feat/github-publish #49

Merge branch 'main' into feat/github-publish

Merge branch 'main' into feat/github-publish #49

Workflow file for this run

name: Node.js Package
on:
release:
types: [created]
push:
branches: [ feat/github-publish ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org/'
- run: npm install
- run: npm run build
- run: npm test
publish-npm:
# if: github.ref == 'refs/heads/main'
# needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org/'
- run: npm adduser --registry=https://github.com/kedarvijaykulkarni/string-utils
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}