Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

release

release #68

Workflow file for this run

name: release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: "Version to tag (e.g., 3.0.3)"
required: true
type: string
permissions:
contents: read
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git
if: github.event_name == 'workflow_dispatch'
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git tag -a v${{ inputs.version }} -m "v${{ inputs.version }}"
git push origin v${{ inputs.version }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile # Install dependencies with lockfile's versions to ensure consistency
- name: Cache Build
id: cache-build
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-build-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx') }} # Cache key based on OS and file hashes
restore-keys: |
${{ runner.os }}-build-
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: pnpm build
- name: Semantic Release
run: pnpx semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}