Skip to content

v3.0.7

v3.0.7 #145

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
release:
types: [published]
workflow_dispatch:
inputs:
publish:
description: 'Publish all packages to npm'
required: false
default: 'false'
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js 20
uses: actions/setup-node@v6
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Test
run: pnpm test
publish:
needs: verify
if: >
(github.event_name == 'release' && github.event.release.target_commitish == 'main') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && github.ref == 'refs/heads/main') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js 20
uses: actions/setup-node@v6
with:
node-version: 20
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Determine npm dist-tag
id: dist-tag
run: |
VERSION=$(node -p "require('./package.json').version")
TAG=""
if echo "$VERSION" | grep -q "-"; then
PRERELEASE="${VERSION#*-}"
PRERELEASE_TAG="${PRERELEASE%%.*}"
case "$PRERELEASE_TAG" in
alpha|beta|rc|next) TAG="$PRERELEASE_TAG" ;;
"") TAG="latest" ;;
*) TAG="$PRERELEASE_TAG" ;;
esac
else
TAG="latest"
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Publishing $VERSION with tag: $TAG"
- name: Publish framework packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm --filter='./packages/*' publish --access public --no-git-checks --tag ${{ steps.dist-tag.outputs.tag }}