Skip to content

Commit

Permalink
Create npm-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
newracket authored Jan 24, 2025
1 parent 414a9dc commit 5823c9a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to npm

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org/"

- name: Install dependencies
run: npm install

- name: Build the package (if using TypeScript)
run: npm run build || echo "No build step"

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 5823c9a

Please sign in to comment.