-
Notifications
You must be signed in to change notification settings - Fork 3
259 lines (229 loc) · 10.4 KB
/
prepare-next-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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-mock'
jobs:
load-release-info:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.load-descriptor.outputs.branch }}
version: ${{ steps.load-descriptor.outputs.version }}
next-version: ${{ steps.load-descriptor.outputs.next-version }}
mock: ${{ steps.load-descriptor.outputs.mock }}
staging-repository: ${{ steps.load-descriptor.outputs.staging-repository }}
steps:
- name: Installing activiti-scripts
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: Alfresco/alfresco-build-tools/.github/actions/load-release-descriptor@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
id: load-descriptor
with:
release-descriptor: release.yaml
maven-update-main-branch-to-next-version:
runs-on: ubuntu-latest
needs: [ load-release-info ]
strategy:
fail-fast: true
matrix:
repo: [ 'Activiti','activiti-cloud' ]
env:
NEXT_VERSION: ${{ needs.load-release-info.outputs.next-version }}
REPO_DIR: repos/${{ matrix.repo }}
BRANCH: ${{ needs.load-release-info.outputs.branch }}
steps:
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Activiti/${{ matrix.repo }}
path: ${{ env.REPO_DIR }}
ref: ${{ env.BRANCH }}
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: update-to-next-version
uses: Alfresco/alfresco-build-tools/.github/actions/maven-update-pom-version@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
with:
version: ${{ env.NEXT_VERSION }}
repository-directory: repos/${{ matrix.repo }}
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
with:
username: ${{ secrets.BOT_GITHUB_USERNAME }}
add-options: -u
commit-message: Update to version ${{ env.NEXT_VERSION}} [skip ci]
repository-directory: ${{ env.REPO_DIR }}
- name: Push changes to branch ${{ env.BRANCH }}
if: needs.load-release-info.outputs.mock == 'false'
working-directory: ${{ env.REPO_DIR }}
run: git push origin "$BRANCH"
helm-update-main-branch-to-next-version:
runs-on: ubuntu-latest
needs: [ load-release-info ]
strategy:
fail-fast: true
matrix:
include:
- repo: activiti-cloud-common-chart
chart-dir: charts/common
- repo: activiti-cloud-full-chart
chart-dir: charts/activiti-cloud-full-example
env:
NEXT_VERSION: ${{ needs.load-release-info.outputs.next-version }}
REPO_DIR: repos/${{ matrix.repo }}
BRANCH: ${{ needs.load-release-info.outputs.branch }}
steps:
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Activiti/${{ matrix.repo }}
path: ${{ env.REPO_DIR }}
ref: ${{ env.BRANCH }}
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Update branch '${{env.BRANCH}}' to the next version
uses: Alfresco/alfresco-build-tools/.github/actions/helm-update-chart-version@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
with:
new-version: ${{ env.NEXT_VERSION }}
chart-repository-dir: ${{ env.REPO_DIR }}
chart-dir: ${{ matrix.chart-dir }}
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
with:
username: ${{ secrets.BOT_GITHUB_USERNAME }}
add-options: -u
commit-message: Update to version ${{ env.NEXT_VERSION}} [skip ci]
repository-directory: ${{ env.REPO_DIR }}
- name: Push changes to branch ${{ env.BRANCH }}
if: needs.load-release-info.outputs.mock == 'false'
working-directory: ${{ env.REPO_DIR }}
run: git push origin "$BRANCH"
maven-create-maintenance-branch:
if: endsWith(needs.load-release-info.outputs.version, '.0') || contains(needs.load-release-info.outputs.version, '.0-mock')
runs-on: ubuntu-latest
needs: [ load-release-info ]
strategy:
fail-fast: true
matrix:
repo: [ 'Activiti','activiti-cloud' ]
env:
REPO_DIR: repos/${{ matrix.repo }}
TAG: ${{ needs.load-release-info.outputs.version }}
steps:
- name: Checkout activiti-scripts
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Activiti/${{ matrix.repo }}
path: ${{ env.REPO_DIR }}
ref: ${{ env.TAG }}
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Create maintenance branch if needed
id: create-maintenance-branch
uses: ./.github/actions/create-maintenance-branch
with:
working-directory: ${{ env.REPO_DIR }}
tag: ${{ env.TAG }}
- name: Set up JDK 21
if: steps.create-maintenance-branch.outputs.exists == 'false'
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: temurin
java-version: 21
cache: 'maven'
- name: Configure Maven settings
if: steps.create-maintenance-branch.outputs.exists == 'false'
shell: bash
env:
MAVEN_SETTINGS_PATH: ${{ github.workspace }}/maven-config/settings.xml
run: |
M2_DIR=$HOME/.m2
cp $MAVEN_SETTINGS_PATH $M2_DIR
ls $M2_DIR
cat $M2_DIR/settings.xml
- name: update-to-next-version
if: steps.create-maintenance-branch.outputs.exists == 'false'
env:
NEXUS_URL: "https://artifacts.alfresco.com/nexus"
STAGING_REPOSITORY_ID: ${{ needs.load-release-info.outputs.staging-repository }}
NEXUS_USERNAME: "${{ secrets.NEXUS_USERNAME }}"
NEXUS_PASSWORD: "${{ secrets.NEXUS_PASSWORD }}"
VERSION: ${{ steps.create-maintenance-branch.outputs.version }}
uses: Alfresco/alfresco-build-tools/.github/actions/maven-update-pom-version@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
with:
version: ${{ env.VERSION }}
repository-directory: ${{ env.REPO_DIR }}
- name: Update configuration files
if: steps.create-maintenance-branch.outputs.exists == 'false'
uses: ./.github/actions/update-ci-branch
with:
repo-path: ${{ env.REPO_DIR }}
branch: ${{ steps.create-maintenance-branch.outputs.branch }}
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
if: steps.create-maintenance-branch.outputs.exists == 'false'
with:
username: ${{ secrets.BOT_GITHUB_USERNAME }}
add-options: -u
commit-message: Update to version ${{ steps.create-maintenance-branch.outputs.version }} [skip ci]
repository-directory: ${{ env.REPO_DIR }}
- name: Push changes to branch ${{ env.BRANCH }}
if: ${{ steps.create-maintenance-branch.outputs.exists == 'false' && needs.load-release-info.outputs.mock == 'false' }}
working-directory: ${{ env.REPO_DIR }}
env:
BRANCH: ${{ steps.create-maintenance-branch.outputs.branch }}
run: git push origin "$BRANCH"
helm-create-maintenance-branch:
if: endsWith(needs.load-release-info.outputs.version, '.0') || contains(needs.load-release-info.outputs.version, '.0-mock')
runs-on: ubuntu-latest
needs: [ load-release-info ]
strategy:
fail-fast: true
matrix:
include:
- repo: activiti-cloud-common-chart
chart-dir: charts/common
- repo: activiti-cloud-full-chart
chart-dir: charts/activiti-cloud-full-example
env:
REPO_DIR: repos/${{ matrix.repo }}
TAG: ${{ needs.load-release-info.outputs.version }}
steps:
- name: Checkout activiti-scripts
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Activiti/${{ matrix.repo }}
path: ${{ env.REPO_DIR }}
ref: ${{ env.TAG }}
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Create maintenance branch if needed
id: create-maintenance-branch
uses: ./.github/actions/create-maintenance-branch
with:
working-directory: ${{ env.REPO_DIR }}
tag: ${{ env.TAG }}
- name: Update maintenance branch '${{env.BRANCH}}' to ${{ env.VERSION }} version
if: steps.create-maintenance-branch.outputs.exists == 'false'
uses: Alfresco/alfresco-build-tools/.github/actions/helm-update-chart-version@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
env:
BRANCH: ${{steps.create-maintenance-branch.outputs.branch}}
VERSION: ${{ steps.create-maintenance-branch.outputs.version }}
with:
new-version: ${{ env.VERSION }}
chart-repository-dir: ${{ env.REPO_DIR }}
chart-dir: ${{ matrix.chart-dir }}
- name: Update configuration files
if: steps.create-maintenance-branch.outputs.exists == 'false'
uses: ./.github/actions/update-ci-branch
with:
repo-path: ${{ env.REPO_DIR }}
branch: ${{ steps.create-maintenance-branch.outputs.branch }}
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@f2259c2bb5ff4a5579d1a425cb130175a6459665 # v5.10.0
if: steps.create-maintenance-branch.outputs.exists == 'false'
with:
username: ${{ secrets.BOT_GITHUB_USERNAME }}
add-options: -u
commit-message: Update to version ${{ steps.create-maintenance-branch.outputs.version }} [skip ci]
repository-directory: ${{ env.REPO_DIR }}
- name: Push changes to branch ${{ env.BRANCH }}
if: ${{ steps.create-maintenance-branch.outputs.exists == 'false' && needs.load-release-info.outputs.mock == 'false' }}
working-directory: ${{ env.REPO_DIR }}
env:
BRANCH: ${{ steps.create-maintenance-branch.outputs.branch }}
run: git push origin "$BRANCH"