-
Notifications
You must be signed in to change notification settings - Fork 1.8k
80 lines (75 loc) · 2.76 KB
/
version.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
name: Version
run-name: ${{ inputs.type }} - ${{ inputs.tag }} by @${{ github.actor }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
type:
required: true
description: 'Specify the type of release'
type: choice
default: preminor
options:
- minor
- preminor
- prerelease
tag:
required: true
description: 'Specify the tag for this release'
type: string
jobs:
version:
runs-on: ubuntu-latest
if: github.repository == 'carbon-design-system/carbon'
timeout-minutes: 60
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: '0'
- name: Use Node.js 20.x
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
id: cache
with:
path: |
node_modules
*/**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
- name: Create preminor release
if: ${{ github.event.inputs.type == 'preminor' }}
run: |
yarn lerna version preminor --no-git-tag-version --preid rc --yes
- name: Create prerelease
if: ${{ github.event.inputs.type == 'prerelease' }}
run: |
yarn lerna version prerelease --no-git-tag-version --preid rc --yes
- name: Create minor release
if: ${{ github.event.inputs.type == 'minor' }}
run: |
yarn lerna version minor --no-git-tag-version --no-push --yes
- name: Generate token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
id: generate_token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
branch: 'release/${{ github.event.inputs.tag }}'
commit-message: 'chore(release): ${{ github.event.inputs.tag }}'
delete-branch: true
title: 'chore(release): ${{ github.event.inputs.tag }}'
token: ${{ steps.generate_token.outputs.token }}
body: |
Automated release PR for ${{ github.event.inputs.tag }}
**Checklist**
- [ ] Verify package version bumps are accurate
- [ ] Verify CI passes as expected