Skip to content

Commit

Permalink
Add auto-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Mar 25, 2024
1 parent b0d4428 commit 3d1115f
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 1,437 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ci

on: [push, pull_request]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- run: npm ci
- run: npm test

- name: Get tag version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT

- name: npm publish
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

0 comments on commit 3d1115f

Please sign in to comment.