Repository navigation
80 lines (70 loc) · 2.55 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (70 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release
on:
workflow_dispatch:
inputs:
mode:
description: Release mode to run
required: true
type: choice
options:
- stable
- rc
- canary
permissions:
contents: write
id-token: write
concurrency:
group: release-${{ github.event.inputs.mode }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
release:
name: Run release
runs-on: ubuntu-latest
env:
# release:check runs validation explicitly; git hooks would duplicate it.
LEFTHOOK: '0'
RELEASE_MODE: ${{ github.event.inputs.mode }}
RELEASE_REF: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHROME_EXTENSION_PEM_BASE64: ${{ secrets.CHROME_EXTENSION_PEM_BASE64 }}
GIT_AUTHOR_NAME: actions-bot
GIT_AUTHOR_EMAIL: actions-bot@users.noreply.github.com
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Configure git identity
run: |
git config user.name "$GIT_AUTHOR_NAME"
git config user.email "$GIT_AUTHOR_EMAIL"
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
# Deliberately no build or dependency cache in this job. It holds
# id-token: write and publishes to npm, so a restored artifact would be
# published with provenance attesting to something that was never built
# from this source. Everything here must be built from a clean checkout.
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run release
run: pnpm release:run
deploy-website:
name: Deploy website
needs: release
# Only stable releases deploy production docs. Canary pushes no tag, and rc
# runs from a release/v* branch, which must not become the production site.
if: github.event.inputs.mode == 'stable'
uses: ./.github/workflows/website-release-deploy.yml
# Do not inherit id-token: write from this workflow — the deploy job must not
# be able to mint an npm trusted-publishing token.
permissions:
contents: read
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}