mirror of
https://github.com/vercel/streamdown.git
synced 2026-09-19 02:18:37 +08:00
71 lines
1.7 KiB
YAML
71 lines
1.7 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '24'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
# Ensure npm 11.5.1 or later is installed
|
|
- name: Update npm
|
|
run: npm install -g npm@latest
|
|
|
|
- name: Install Dependencies
|
|
run: pnpm i
|
|
|
|
- name: Build Packages
|
|
run: pnpm build:packages
|
|
|
|
- name: Build Website
|
|
run: pnpm build --filter website
|
|
|
|
- name: Run Tests
|
|
run: pnpm test
|
|
|
|
- name: Check Linting and Formatting
|
|
run: pnpm check
|
|
|
|
- name: Create Release Pull Request or Publish to npm
|
|
id: changesets
|
|
uses: changesets/action@v1
|
|
with:
|
|
version: pnpm changeset version
|
|
publish: pnpm changeset publish
|
|
# github-api creates verified commits (required by repo rules);
|
|
# git-cli commits are unsigned and get rejected on push.
|
|
commitMode: github-api
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: "" # Workaround for https://github.com/changesets/action/pull/545
|
|
|
|
- name: Deploy to Vercel
|
|
if: steps.changesets.outputs.published == 'true'
|
|
run: npx vercel --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|