-
Notifications
You must be signed in to change notification settings - Fork 1
398 lines (386 loc) · 15.9 KB
/
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
name: Publish
on:
pull_request:
branches: [ "main" ]
types:
- closed
jobs:
detect-changes:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
lega-commander: ${{ steps.changes.outputs.lega-commander }}
e2eTests: ${{ steps.changes.outputs.e2eTests }}
clearinghouse: ${{ steps.changes.outputs.clearinghouse }}
crypt4gh: ${{ steps.changes.outputs.crypt4gh }}
tsd-file-api-client: ${{ steps.changes.outputs.tsd-file-api-client }}
cega-mock: ${{ steps.changes.outputs.cega-mock }}
localega-tsd-proxy: ${{ steps.changes.outputs.localega-tsd-proxy }}
mq-interceptor: ${{ steps.changes.outputs.mq-interceptor }}
tsd-api-mock: ${{ steps.changes.outputs.tsd-api-mock }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lega-commander:
- 'cli/lega-commander/**'
e2eTests:
- 'e2eTests/**'
clearinghouse:
- 'lib/clearinghouse/**'
crypt4gh:
- 'lib/crypt4gh/**'
tsd-file-api-client:
- 'lib/tsd-file-api-client/**'
cega-mock:
- 'services/cega-mock/**'
localega-tsd-proxy:
- 'services/localega-tsd-proxy/**'
mq-interceptor:
- 'services/mq-interceptor/**'
tsd-api-mock:
- 'services/tsd-api-mock/**'
get-new-tag-clearinghouse:
needs: detect-changes
if: needs.detect-changes.outputs.clearinghouse == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "clearinghouse"
publish-clearinghouse:
needs: get-new-tag-clearinghouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Bump patch version for clearinghouse
id: bump_clearinghouse_version
run: echo "new_clearinghouse_version=${{ needs.get-new-tag-clearinghouse.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Release clearinghouse
run: |
./gradlew :lib:clearinghouse:build -Pversion=${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}
./gradlew :lib:clearinghouse:publish -Pversion=${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "clearinghouse-${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}"
prerelease: false
get-new-tag-crypt4gh:
needs: detect-changes
if: needs.detect-changes.outputs.crypt4gh == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "crypt4gh"
publish-crypt4gh:
needs: get-new-tag-crypt4gh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Bump patch version for crypt4gh
id: bump_crypt4gh_version
run: echo "new_crypt4gh_version=${{ needs.get-new-tag-crypt4gh.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Release crypt4gh
run: |
./gradlew :lib:crypt4gh:build -Pversion=${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}
./gradlew :lib:crypt4gh:publish -Pversion=${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "crypt4gh-${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}"
prerelease: false
get-new-tag-tsd-file-api-client:
needs: detect-changes
if: needs.detect-changes.outputs.tsd-file-api-client == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "tsd-file-api-client"
publish-tsd-file-api-client:
needs: get-new-tag-tsd-file-api-client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Bump patch version for tsd-file-api-client
id: bump_tsd_file_api_client_version
run: echo "new_tsd_file_api_client_version=${{ needs.get-new-tag-tsd-file-api-client.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Release tsd-file-api-client
run: |
./gradlew :lib:tsd-file-api-client:build -Pversion=${{ steps.bump_tsd_file_api_client_version.outputs.new_tsd_file_api_client_version }}
./gradlew :lib:tsd-file-api-client:publish -Pversion=${{ steps.bump_tsd_file_api_client_version.outputs.new_tsd_file_api_client_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "tsd-file-api-client-${{ steps.bump_tsd_file_api_client_version.outputs.new_tsd_file_api_client_version }}"
prerelease: false
get-new-tag-localega-tsd-proxy:
needs: detect-changes
if: needs.detect-changes.outputs.localega-tsd-proxy == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "localega-tsd-proxy"
publish-localega-tsd-proxy:
needs: get-new-tag-localega-tsd-proxy
runs-on: ubuntu-latest
steps:
- name: Bump patch version for localega-tsd-proxy
id: bump_localega_tsd_proxy_version
run: echo "new_localega_tsd_proxy_version=${{ needs.get-new-tag-localega-tsd-proxy.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Set Repository Name
id: repo_name
run: |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV
- name: Log in to the Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag
run: |
docker pull ghcr.io/${{ env.repo_name }}:localega-tsd-proxy-${{ github.event.number }}
docker tag ghcr.io/${{ env.repo_name }}:localega-tsd-proxy-${{ github.event.number }} ghcr.io/${{ env.repo_name }}:localega-tsd-proxy-${{ steps.bump_localega_tsd_proxy_version.outputs.new_localega_tsd_proxy_version }}
docker push ghcr.io/${{ env.repo_name }}:localega-tsd-proxy-${{ steps.bump_localega_tsd_proxy_version.outputs.new_localega_tsd_proxy_version }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "localega-tsd-proxy-${{ steps.bump_localega_tsd_proxy_version.outputs.new_localega_tsd_proxy_version }}"
prerelease: false
get-new-tag-tsd-api-mock:
needs: detect-changes
if: needs.detect-changes.outputs.tsd-api-mock == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "tsd-api-mock"
publish-tsd-api-mock:
needs: get-new-tag-tsd-api-mock
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Bump patch version for tsd-api-mock
id: bump_tsd_api_mock_version
run: echo "new_tsd_api_mock_version=${{ needs.get-new-tag-tsd-api-mock.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Build with Gradle
run: ./gradlew :services:tsd-api-mock:assemble -Pversion=${{ steps.bump_tsd_api_mock_version.outputs.new_tsd_api_mock_version }}
- name: Set Repository Name
id: repo_name
run: |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV
- name: Log in to the Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./services/tsd-api-mock
push: true
no-cache: 'true'
tags: |
ghcr.io/${{ env.repo_name }}:tsd-api-mock-${{ steps.bump_tsd_api_mock_version.outputs.new_tsd_api_mock_version }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "tsd-api-mock-${{ steps.bump_tsd_api_mock_version.outputs.new_tsd_api_mock_version }}"
prerelease: false
get-new-tag-cega-mock:
needs: detect-changes
if: needs.detect-changes.outputs.cega-mock == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "cega-mock"
publish-cega-mock:
needs: get-new-tag-cega-mock
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump patch version for cega-mock
id: bump_cega_mock_version
run: echo "new_cega_mock_version=${{ needs.get-new-tag-cega-mock.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Set Repository Name
id: repo_name
run: |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV
- name: Log in to the Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./services/cega-mock
push: true
no-cache: 'true'
tags: |
ghcr.io/${{ env.repo_name }}:cega-mock-${{ steps.bump_cega_mock_version.outputs.new_cega_mock_version }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "cega-mock-${{ steps.bump_cega_mock_version.outputs.new_cega_mock_version }}"
prerelease: false
get-new-tag-mq-interceptor:
needs: detect-changes
if: needs.detect-changes.outputs.mq-interceptor == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "mq-interceptor"
publish-mq-interceptor:
needs: get-new-tag-mq-interceptor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump patch version for mq-interceptor
id: bump_mq_interceptor_version
run: echo "new_mq_interceptor_version=${{ needs.get-new-tag-mq-interceptor.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Set Repository Name
id: repo_name
run: |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV
- name: Log in to the Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag
run: |
docker pull ghcr.io/${{ env.repo_name }}:mq-interceptor-${{ github.event.number }}
docker tag ghcr.io/${{ env.repo_name }}:mq-interceptor-${{ github.event.number }} ghcr.io/${{ env.repo_name }}:mq-interceptor-${{ steps.bump_mq_interceptor_version.outputs.new_mq_interceptor_version }}
docker push ghcr.io/${{ env.repo_name }}:mq-interceptor-${{ steps.bump_mq_interceptor_version.outputs.new_mq_interceptor_version }}
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "mq-interceptor-${{ steps.bump_mq_interceptor_version.outputs.new_mq_interceptor_version }}"
prerelease: false
get-new-tag-lega-commander:
needs: detect-changes
if: needs.detect-changes.outputs.lega-commander == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "lega-commander"
publish-lega-commander:
needs: get-new-tag-lega-commander
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
id: go
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump patch version for lega-commander
id: bump_lega_commander_version
run: echo "new_lega_commander_version=${{ needs.get-new-tag-lega-commander.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Create and push new tag
run: |
git tag v${{ steps.bump_lega_commander_version.outputs.new_lega_commander_version }} ${{ github.sha }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
workdir: cli/lega-commander
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CGO_ENABLED: "0"
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "lega-commander-${{ steps.bump_lega_commander_version.outputs.new_lega_commander_version }}"
prerelease: false
get-new-tag-e2eTests:
needs: detect-changes
if: needs.detect-changes.outputs.e2eTests == 'true'
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "e2eTests"
release-e2eTests:
needs: get-new-tag-e2eTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump patch version for e2eTests
id: bump_e2eTests_version
run: echo "new_e2eTests_version=${{ needs.get-new-tag-e2eTests.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: e2eTests-${{ steps.bump_e2eTests_version.outputs.new_e2eTests_version }}
prerelease: false
get-new-tag-fega-norway:
if: github.event.pull_request.merged == true
uses: ./.github/workflows/read-new-version.yml
with:
component_name: "FEGA-Norway"
release-fega-norway:
needs: get-new-tag-fega-norway
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump patch version for FEGA-Norway
id: bump_fega_norway_version
run: echo "new_fega_norway_version=${{ needs.get-new-tag-fega-norway.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: FEGA-Norway-${{ steps.bump_fega_norway_version.outputs.new_fega_norway_version }}
prerelease: false