Skip to content

Commit

Permalink
ci: add publish wkf
Browse files Browse the repository at this point in the history
  • Loading branch information
Mg30 committed Jan 1, 2025
1 parent cfab45d commit b2a393b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Node.js Package

on:
push:
tags:
- "*" # Triggers on all tags

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Specify your Node.js version
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: npm publish

- name: Notify success
if: success()
run: echo "Package published successfully!"

0 comments on commit b2a393b

Please sign in to comment.