-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (83 loc) · 2.45 KB
/
release-packages.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
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
name: Prepare Release
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release Type'
type: choice
options:
- 'graduate'
- 'prerelease'
required: true
default: 'prerelease'
target_branch:
description: 'Target Branch'
type: choice
options:
- 'master'
- 'next'
required: true
default: 'next'
preid:
description: 'Prefix Id'
type: choice
options:
- 'latest'
- 'next'
- 'rc'
- 'dev'
- 'alpha'
- 'beta'
required: true
default: 'next'
exact_version:
description: 'Exact Version'
type: string
required: false
permissions:
contents: write
id-token: write
jobs:
tag-version:
name: Tag Version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.target_branch }}
fetch-depth: 0
- name: Config Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Prerelease Version (Exact Version)
if: ${{ github.event.inputs.release_type == 'prerelease' && github.event.inputs.exact_version }}
run: |
pnpm version ${{ github.event.inputs.exact_version }} \
--workspaces-update \
--no-git-tag-version \
--no-commit-hooks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prerelease Version
if: ${{ github.event.inputs.release_type == 'prerelease' && !github.event.inputs.exact_version }}
run: |
pnpm version prerelease \
--preid ${{ github.event.inputs.preid }} \
--workspaces-update \
--no-git-tag-version \
--no-commit-hooks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Graduate Version
if: ${{ github.event.inputs.release_type == 'graduate' }}
run: pnpm version --workspaces-update from-git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push Changes to Branch
run: |
git push origin ${{ github.event.inputs.target_branch }} --no-verify
git push origin --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}