Skip to content

Commit

Permalink
feat: deploy with ci/cd
Browse files Browse the repository at this point in the history
Deploy to npm after a release has been published.

PR: #30
  • Loading branch information
jbergstroem authored Aug 2, 2024
1 parent 64dd86c commit d399782
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
release:
types: [published]

jobs:
npm-publish:
name: Publish to NPM
runs-on: ubuntu-22.04

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

- uses: oven-sh/setup-bun@v2
- run: bun install

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Run tests
run: bun test

- name: Build artifacts
run: node_modules/.bin/tsup

- name: Publish to npm
id: publish
run: |
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm publish --access public --no-git-checks

0 comments on commit d399782

Please sign in to comment.