Skip to content

chore(release): v0.0.28 #27

chore(release): v0.0.28

chore(release): v0.0.28 #27

Workflow file for this run

name: Publish Package and Create Release
on:
push:
tags:
- 'v*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Publish to npm
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get Changelog Entry
id: get_changelog
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [ -f CHANGELOG.md ]; then
CHANGELOG_ENTRY=$(awk "/^## \[$VERSION\]/ {flag=1;next} /^## \[/ {flag=0} flag" CHANGELOG.md)
else
CHANGELOG_ENTRY="Release $VERSION"
fi
CHANGELOG_ENTRY="${CHANGELOG_ENTRY//'%'/'%25'}"
CHANGELOG_ENTRY="${CHANGELOG_ENTRY//$'\n'/'%0A'}"
CHANGELOG_ENTRY="${CHANGELOG_ENTRY//$'\r'/'%0D'}"
echo "changelog=$CHANGELOG_ENTRY" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
body: |
${{ steps.get_changelog.outputs.changelog }}
draft: false
prerelease: false
files: |
./dist/index.cjs
./dist/index.mjs
./dist/index.d.ts