Skip to content

chore(release): v0.3.1 #2

chore(release): v0.3.1

chore(release): v0.3.1 #2

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
env:
HUSKY: 0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 10.22.0
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: "https://registry.npmjs.org"
- name: Install
run: pnpm install --frozen-lockfile
- name: Sanity Checks
run: pnpm run prepublish
- name: Publish To Npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public --no-git-checks --provenance
- name: Generate Changelog
shell: bash
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
PREV_TAG="$(git tag --sort=-v:refname | grep -E '^v' | grep -v "^${TAG}$" | head -n 1 || true)"
{
echo "## ${TAG}"
echo
if [ -n "${PREV_TAG}" ]; then
echo "Changes since ${PREV_TAG}:"
echo
git log "${PREV_TAG}..${TAG}" --pretty=format:'- %s (%h)'
else
echo "Changes:"
echo
git log "${TAG}" --pretty=format:'- %s (%h)'
fi
} > RELEASE_NOTES.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md