Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Promote to latest

on:
workflow_dispatch:
inputs:
version:
description: "Version to promote (e.g. 2.18.0). Leave empty to use version from package.json."
required: false
type: string

jobs:
promote:
name: Promote npm dist-tag to latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-bun

- name: Configure npm auth
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Promote to latest
run: |
if [ -n "${{ inputs.version }}" ]; then
bun run promote:latest "${{ inputs.version }}"
else
bun run promote:latest
fi
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release

on:
push:
tags:
- "v*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-bun

- name: Build
run: bun run build

- name: Configure npm auth
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm (next)
run: bun run publish:next

github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate release notes
id: notes
run: |
# Get the previous tag
PREV_TAG=$(git tag --sort=-version:refname | grep -v "$(git describe --tags --exact-match)" | head -1)
if [ -z "$PREV_TAG" ]; then
echo "body=Initial release" >> "$GITHUB_OUTPUT"
else
NOTES=$(git log --pretty=format:"- %s" "${PREV_TAG}..HEAD" --no-merges)
{
echo "body<<EOF"
echo "$NOTES"
echo "EOF"
} >> "$GITHUB_OUTPUT"
fi

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.notes.outputs.body }}
generate_release_notes: true
Loading