Skip to content

Commit

Permalink
chore: update npm-publish.yml (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajjartejas committed Jun 16, 2023
1 parent c19547a commit b716621
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# 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: Release
name: Node.js Package

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

jobs:
release:
if: github.event.repository.fork == false
name: Release
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
node-version: 16
- run: npm ci
- run: npm test

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

0 comments on commit b716621

Please sign in to comment.