Skip to content

Commit

Permalink
ci: update npm-publish workflow to trigger on push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
chessurisme committed Jan 27, 2025
1 parent 68cf9b8 commit 7e702c3
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@
name: Node.js Package

on:
release:
types: [created]
push:
branches:
- main

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
node-version: '14'

- name: Install dependencies
run: npm install

- name: Authenticate with npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish package
run: npm publish

0 comments on commit 7e702c3

Please sign in to comment.