Skip to content

release: 4.7.2 (#702) #160

release: 4.7.2 (#702)

release: 4.7.2 (#702) #160

name: Release Please
on:
push:
branches:
- main
tags:
- 'v*-preview*'
workflow_dispatch:
inputs:
publish_only:
description: 'Skip release-please and only run publish'
type: boolean
default: false
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-please:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ steps.app-token.outputs.token }}
publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' || inputs.publish_only == true }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: pnpm install --frozen-lockfile
- run: pnpm run build
env:
ANALYTICS_ENDPOINT: ${{ secrets.ANALYTICS_ENDPOINT }}
- name: Publish to npm
run: npm publish --provenance --access public
# Preview publish — triggered by pushing a tag matching v*-preview*
preview-test:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm test
preview-typecheck:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm run typecheck
preview-lint:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm run check
preview-publish:
needs: [preview-test, preview-typecheck, preview-lint]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: pnpm install --frozen-lockfile
- name: Set preview version from tag
run: |
VERSION="${GITHUB_REF_NAME#v}"
npm version "$VERSION" --no-git-tag-version
- run: pnpm run build
env:
ANALYTICS_ENDPOINT: ${{ secrets.ANALYTICS_ENDPOINT }}
- name: Publish preview to npm
run: npm publish --tag next --provenance --access public