-
-
Notifications
You must be signed in to change notification settings - Fork 266
95 lines (85 loc) · 2.88 KB
/
Copy pathprepare-release.yml
File metadata and controls
95 lines (85 loc) · 2.88 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Prepare Release
on:
workflow_dispatch:
inputs:
package:
description: Package to release
required: true
default: plugin-react
type: choice
options:
- plugin-react
- plugin-react-swc
- plugin-rsc
release:
description: Release type
required: true
default: next
type: choice
options:
- next
- patch
- minor
- major
- prepatch
- preminor
- premajor
version:
description: Specify exact version instead of bumpp release type
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ inputs.package }}-${{ inputs.version || inputs.release }}
cancel-in-progress: false
permissions: {}
jobs:
prepare:
if: github.repository == 'vitejs/vite-plugin-react'
name: Prepare release PR
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
fetch-depth: 0
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Set node version
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
package-manager-cache: false
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
- name: Prepare release
id: prepare
env:
RELEASE: ${{ inputs.version || inputs.release }}
RELEASE_PACKAGE: ${{ inputs.package }}
run: |
node scripts/prepare-release.ts "$RELEASE_PACKAGE" "$RELEASE" >> "$GITHUB_OUTPUT"
- id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.RELEASE_GITHUB_APP_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-contents: write
permission-pull-requests: write
- name: Open release PR
uses: vitejs/release-scripts/action/release-pr@bec07424241c85b28458756d0ef9edbb130dc63e # v1.9.1
with:
app-slug: ${{ steps.generate-token.outputs.app-slug }}
token: ${{ steps.generate-token.outputs.token }}
package-name: ${{ inputs.package }}
package-path: packages/${{ inputs.package }}
pr-body: ${{ steps.prepare.outputs.pr_body }}
tag: ${{ steps.prepare.outputs.tag }}
version: ${{ steps.prepare.outputs.version }}