mirror of
https://github.com/vercel/streamdown.git
synced 2026-09-19 02:18:37 +08:00
83 lines
2.1 KiB
YAML
83 lines
2.1 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: Generate GitHub App Token
|
|
id: generate-token
|
|
uses: actions/create-github-app-token@v1
|
|
with:
|
|
app-id: ${{ secrets.STREAMDOWN_APP_ID }}
|
|
private-key: ${{ secrets.STREAMDOWN_APP_PRIVATE_KEY }}
|
|
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
|
|
- name: Setup Git User
|
|
run: |
|
|
git config --global user.email "streamdown-bot[bot]@users.noreply.github.com"
|
|
git config --global user.name "streamdown-bot[bot]"
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- uses: actions/setup-node@v6
|
|
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
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.generate-token.outputs.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 }}
|