Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
lint-test:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
- run: |
npm ci
npm run lint
npm run format
npm run test
npm run build
release:
name: Release & Publish
runs-on: ubuntu-latest
needs: lint-test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- name: Sync version with release tag
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/}"
npm version "$TAG_VERSION" --no-git-tag-version
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "chore: bump version to ${GITHUB_REF#refs/tags/}"
git push origin HEAD:main
- run: |
npm run build
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}