Skip to content

Commit

Permalink
Create npm-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DruuuCLT authored Jul 11, 2024
1 parent 2505f08 commit c5b43d9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to npm

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # Specify the Node.js version you want to use

- name: Install dependencies
run: npm install

- name: Bump version
run: npm version patch # or 'minor' or 'major' depending on your versioning strategy

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

- name: Publish to npm
run: npm publish

- name: Push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git push origin HEAD:master --follow-tags

0 comments on commit c5b43d9

Please sign in to comment.