Skip to content

Publish UI Kit

Publish UI Kit #8

name: Publish UI Kit
on:
workflow_dispatch:
inputs:
bump-type:
description: 'Version bump type'
required: true
type: choice
options:
- patch
- minor
- major
alpha:
description: 'Publish as alpha pre-release?'
required: true
type: boolean
default: false
permissions:
contents: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
# Node 24.18.0 bundles npm 11.16.0, which supports trusted publishing.
node-version: '24.18.0'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Install dependencies
run: |
corepack enable
yarn install --immutable
# GitHub's cached Node toolchain can omit npm's declared sigstore runtime
# dependency. Keep it isolated from the project and expose it to npm.
- name: Prepare npm provenance dependency
run: |
npm install --prefix "$RUNNER_TEMP/npm-provenance-deps" --no-save --ignore-scripts sigstore@4.1.1
NODE_PATH="$RUNNER_TEMP/npm-provenance-deps/node_modules" node -e "require('sigstore')"
echo "NODE_PATH=$RUNNER_TEMP/npm-provenance-deps/node_modules" >> "$GITHUB_ENV"
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Release and publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash scripts/release-automated.sh ui-kit ${{ inputs.bump-type }} ${{ inputs.alpha }}
- name: Create GitHub Release
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./packages/ui-kit/package.json').version")
TAG="ui-kit@$VERSION"
CHANGELOG_FILE="packages/ui-kit/CHANGELOG.md"
if [ -f "$CHANGELOG_FILE" ]; then
LATEST_NOTES=$(awk '/^---$/ { exit } { print }' "$CHANGELOG_FILE")
gh release create "$TAG" --title "🚀 $TAG" --notes "$LATEST_NOTES" --latest
else
gh release create "$TAG" --title "🚀 $TAG" --notes "Automated release of $TAG" --latest
fi