Skip to content

Commit

Permalink
chore: update npm-publish.yml (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajjartejas committed Jun 16, 2023
1 parent a6965c0 commit 34a4a3f
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

name: Release
on:
release:
types: [created]
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
release:
if: github.event.repository.fork == false
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v2
with:
node-version: 16
- run: npm install --package-lock-only
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
- name: Install dependencies
run: yarn ci:install
- name: Release
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.npm_token }}
run: yarn ci:shipit

0 comments on commit 34a4a3f

Please sign in to comment.