-
Notifications
You must be signed in to change notification settings - Fork 113
155 lines (132 loc) · 4.88 KB
/
release.yml
File metadata and controls
155 lines (132 loc) · 4.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
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
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
jobs:
build:
uses: './.github/workflows/build.yml'
test:
needs: ['build']
uses: './.github/workflows/test.yml'
with:
reportCoverage: false
check-charts-compat-peer-deps:
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:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.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}" \
--force-publish \
--exact \
--no-push \
--no-git-tag-version \
--allow-branch ${{ github.ref_name }}
build-and-release:
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.ACCESS_TOKEN }}
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install and build
run: |
npm install -g npm
yarn install --immutable
- name: version - Release
if: ${{ github.event.inputs.snapshot == 'false' }}
run: |
git config user.email ${{ secrets.BOT_GIT_EMAIL }}
git config user.name ${{ secrets.BOT_GIT_USERNAME }}
${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.snapshot == 'true' }}
run: |
git_hash=$(git rev-parse --short "${{ github.sha }}")
${GITHUB_WORKSPACE}/node_modules/.bin/lerna version "0.0.0-${git_hash}" \
--force-publish \
--exact \
--no-push \
--no-git-tag-version \
--allow-branch ${{ github.ref_name }}
- name: build
run: yarn build
- name: publish to npm
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
### Semantic Release Bot comments for issues and PRs ###
- name: Add release comments to issues and PRs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.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 })