-
Notifications
You must be signed in to change notification settings - Fork 23
51 lines (50 loc) · 2.06 KB
/
prepare-release.yml
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
name: Prepare a Release on GitHub
on:
workflow_dispatch:
inputs:
version:
type: choice
description: Which version to prepare a release?
options:
- nextrc
- preminor
- minor
- patch
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure the user for Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- uses: pnpm/[email protected]
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- name: Install the dependencies
run: pnpm install
- name: Create a release
if: ${{ ! startsWith(inputs.version, 'pre') && ! startsWith(inputs.version, 'next') }}
run: pnpm release-it ${{ inputs.version }} --no-npm.publish --npm.skipChecks --git.requireBranch="release/*" --github.release --github.draft --github.autoGenerate --github.releaseName='v${version}' --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a pre-release for a new version
if: startsWith(inputs.version, 'pre')
run: pnpm release-it preminor --preRelease=rc --no-npm.publish --npm.skipChecks --git.requireBranch="release/*" --github.release --github.draft --github.autoGenerate --github.releaseName='v${version}' --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a pre-release for a current version
if: startsWith(inputs.version, 'next')
run: pnpm release-it --preRelease=rc --no-npm.publish --npm.skipChecks --git.requireBranch="release-*" --github.release --github.draft --github.autoGenerate --github.releaseName='v${version}' --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}