-
Notifications
You must be signed in to change notification settings - Fork 111
185 lines (160 loc) · 6.41 KB
/
release.yml
File metadata and controls
185 lines (160 loc) · 6.41 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: 'Release'
on:
workflow_dispatch:
inputs:
release_type:
type: string
description: 'Release Type: Lerna Auto Versioning if empty.'
required: false
default: ''
prerelease:
type: boolean
description: 'pre-release'
required: false
default: false
snapshot:
type: boolean
description: 'Release as snapshot. This setting has precedence over all other inputs.'
required: false
default: false
publish_only:
type: boolean
description: 'Skip versioning and only publish existing tags to npm. Use when a previous release failed during publish.'
required: false
default: false
jobs:
build:
if: ${{ github.event.inputs.publish_only != 'true' }}
uses: './.github/workflows/build.yml'
test:
if: ${{ github.event.inputs.publish_only != 'true' }}
needs: ['build']
uses: './.github/workflows/test.yml'
with:
reportCoverage: false
check-charts-compat-peer-deps:
if: ${{ github.event.inputs.publish_only != 'true' }}
runs-on: ubuntu-latest
environment: charts-peer-deps-approval
steps:
- name: No-op
run: echo "Did you update the peer dependencies of the charts and compat package?"
release-dryrun:
if: ${{ github.event.inputs.publish_only != 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: |
npm install -g npm
yarn install --immutable
- name: version - Release
if: ${{ github.event.inputs.snapshot == 'false' }}
run: |
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version ${{ github.event.inputs.release_type }} \
${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \
--no-push \
--no-git-tag-version
- name: version - Snapshot
if: ${{ github.event.inputs.snapshot == 'true' }}
run: |
git_hash=$(git rev-parse --short "${{ github.sha }}")
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version "0.0.0-${git_hash}" \
--exact \
--no-push \
--no-git-tag-version \
--allow-branch ${{ github.ref_name }}
build-and-release:
if: ${{ !cancelled() && (github.event.inputs.publish_only == 'true' || (needs.test.result == 'success' && needs.release-dryrun.result == 'success' && needs.check-charts-compat-peer-deps.result == 'success')) }}
needs: ['test', 'release-dryrun', 'check-charts-compat-peer-deps']
runs-on: ubuntu-latest
environment:
name: 'npm'
url: 'https://www.npmjs.com/package/@ui5/webcomponents-react'
permissions:
contents: write
id-token: write
issues: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.ACCESS_TOKEN }}
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install and build
run: |
npm install -g npm
yarn install --immutable
- name: List packages to publish
if: ${{ github.event.inputs.publish_only == 'true' }}
run: ${GITHUB_WORKSPACE}/node_modules/.bin/lerna ls --json
- name: Setup Git User
if: ${{ github.event.inputs.publish_only != 'true' }}
run: |
git config user.email ${{ secrets.BOT_GIT_EMAIL }}
git config user.name ${{ secrets.BOT_GIT_USERNAME }}
- name: version - Release
if: ${{ github.event.inputs.publish_only != 'true' && github.event.inputs.snapshot == 'false' }}
run: |
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version ${{ github.event.inputs.release_type }} \
${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \
--create-release github
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: version - Snapshot
if: ${{ github.event.inputs.publish_only != 'true' && github.event.inputs.snapshot == 'true' }}
run: |
git_hash=$(git rev-parse --short "${{ github.sha }}")
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version "0.0.0-${git_hash}" \
--exact \
--no-push \
--allow-branch ${{ github.ref_name }}
- name: build
run: yarn build
- name: build mcp-server data
run: yarn build:mcp
- name: publish to npm
if: ${{ github.event.inputs.publish_only != 'true' }}
run: |
${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-git ${{ (github.event.inputs.snapshot == 'true' && '--pre-dist-tag dev') || '' }}
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: publish to npm (from-package)
if: ${{ github.event.inputs.publish_only == 'true' }}
run: |
${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-package
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
NPM_CONFIG_PROVENANCE: true
### Semantic Release Bot comments for issues and PRs ###
- name: Add release comments to issues and PRs
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
if: ${{ github.event.inputs.snapshot == 'false' }}
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueCommentsForRelease.mjs');
await addIssueComments({ github, context })
publish-mcp-registry:
needs: ['build-and-release']
if: ${{ github.event.inputs.snapshot == 'false' && github.event.inputs.prerelease == 'false' }}
uses: './.github/workflows/publish-mcp-registry.yml'
permissions:
id-token: write
contents: read