Skip to content

(patch) release by @robertherber #29

(patch) release by @robertherber

(patch) release by @robertherber #29

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: NPM Publish
run-name: ${{ inputs.description }} (${{ inputs.release_type }}) release by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
description:
description: 'Description'
required: false
type: string
release_type:
description: 'Release Type'
required: true
default: 'patch'
type: choice
options:
- 'patch'
- 'minor'
- 'major'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install
- run: bun lint
- run: bun typecheck
publish-to-npm:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: git config user.name "$(git log -n 1 --pretty=format:%an)"
- run: git config user.email "$(git log -n 1 --pretty=format:%ae)"
- run: echo "versionTag=`npm version ${{ github.event.inputs.release_type }} -m "%s ${{ github.event.inputs.description }}"`" >> $GITHUB_ENV
- run: bun install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- run: git push --follow-tags
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.versionTag }} ${{ github.event.inputs.description }}
tag_name: ${{ env.versionTag }}
generate_release_notes: true