Skip to content

Commit

Permalink
Merge pull request #2 from dammy001/dammy001-patch-1
Browse files Browse the repository at this point in the history
Create npm-publish.yml
  • Loading branch information
dammy001 committed Jan 7, 2022
2 parents dad7972 + 98fa181 commit 70b6713
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- run: npm run build --if-present

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- run: git config --global user.name "dammy001"
- run: git config --global user.email "damilareanjorin1@gmail.com"

- run: npm version ${{ github.event.release.tag_name }}
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# push the version changes to GitHub
- run: git push
env:
# The secret is passed automatically. Nothing to configure.
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 70b6713

Please sign in to comment.