Skip to content

Release v0.2.3

Release v0.2.3 #6

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.3.9
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Verify tag matches package version
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION=$(node -p "require('./package.json').version")
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
exit 1
fi
- name: Run CI checks
run: bun run ci
- name: Build release binary
run: bun run build:binary
- name: Prepare release assets
run: |
mkdir -p artifacts
cp dist/bin/pump-kit artifacts/pump-kit-linux-x64
chmod +x artifacts/pump-kit-linux-x64
sha256sum artifacts/pump-kit-linux-x64 > artifacts/pump-kit-linux-x64.sha256
tar -czf artifacts/pump-kit-linux-x64.tar.gz -C artifacts pump-kit-linux-x64
- name: Build release notes from commits
id: release_notes
if: startsWith(github.ref, 'refs/tags/')
run: |
CURRENT_TAG="${GITHUB_REF_NAME}"
PREV_TAG=$(git describe --tags --abbrev=0 "${CURRENT_TAG}^" 2>/dev/null || true)
if [ -n "$PREV_TAG" ]; then
NOTES=$(git log --pretty=format:'- %s (%h)' "${PREV_TAG}..${CURRENT_TAG}")
else
NOTES=$(git log --pretty=format:'- %s (%h)' "${CURRENT_TAG}")
fi
if [ -z "$NOTES" ]; then
NOTES="- Initial release"
fi
{
echo "body<<EOF"
echo "## Changes"
echo "$NOTES"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Publish to npm
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.release_notes.outputs.body }}
files: |
artifacts/pump-kit-linux-x64
artifacts/pump-kit-linux-x64.sha256
artifacts/pump-kit-linux-x64.tar.gz