Skip to content

fix: don't render empty mermaid graph when only test nodes downstream #39

fix: don't render empty mermaid graph when only test nodes downstream

fix: don't render empty mermaid graph when only test nodes downstream #39

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Typecheck
run: bun run typecheck
- name: Unit tests
run: bun test test/unit/
- name: Build dist/
run: bun run build
- name: Verify dist/index.js exists
run: test -f dist/index.js
- name: Parse version info
id: version
run: |
TAG="${GITHUB_REF#refs/tags/}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
# Extract major version (e.g., v1 from v1.2.3)
MAJOR=$(echo "$TAG" | grep -oE '^v[0-9]+')
echo "major=$MAJOR" >> "$GITHUB_OUTPUT"
# Detect pre-release
if echo "$TAG" | grep -qE '-(alpha|beta|rc)'; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.version.outputs.tag }}"
PRERELEASE_FLAG=""
if [ "${{ steps.version.outputs.prerelease }}" = "true" ]; then
PRERELEASE_FLAG="--prerelease"
fi
gh release create "$TAG" \
--repo "$GITHUB_REPOSITORY" \
--generate-notes \
$PRERELEASE_FLAG
- name: Update floating major tag
if: steps.version.outputs.prerelease == 'false'
run: |
MAJOR="${{ steps.version.outputs.major }}"
git tag -f "$MAJOR"
git push origin "$MAJOR" --force