mirror of
https://github.com/vercel/ai-elements.git
synced 2026-09-14 19:48:26 +08:00
5a89c03010
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
79 lines
2.1 KiB
YAML
79 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@v2
|
|
with:
|
|
app-id: ${{ secrets.AI_ELEMENTS_APP_ID }}
|
|
private-key: ${{ secrets.AI_ELEMENTS_APP_PRIVATE_KEY }}
|
|
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v6
|
|
with:
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
|
|
- name: Setup Git User
|
|
run: |
|
|
git config --global user.email "ai-elements-bot[bot]@users.noreply.github.com"
|
|
git config --global user.name "ai-elements-bot[bot]"
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
|
|
- 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: Install Playwright Browsers
|
|
run: pnpm --filter @repo/elements exec playwright install --with-deps chromium
|
|
|
|
- name: Build Packages and Docs
|
|
run: pnpm build --filter ai-elements --filter docs
|
|
|
|
- name: Run Tests
|
|
run: pnpm test
|
|
|
|
- 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 }}
|