Skip to content

Commit 44b6a5c

Browse files
committed
Split build and release jobs
1 parent f6bbc69 commit 44b6a5c

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,25 @@ jobs:
1717
java-version: 21
1818
build-command: ./gradlew build coverage
1919

20-
snapshot:
21-
uses: ./.github/workflows/release.yml
20+
release:
21+
uses: ./.github/workflows/release-auto.yml
2222
needs: build
2323
secrets: inherit
2424
if: |
2525
needs.build.result == 'success'
26-
&& github.event_name == 'pull_request'
26+
&& github.event_name == 'push'
27+
&& github.ref_name == github.event.repository.default_branch || (startsWith(github.ref_name, 'v') && endsWith(github.ref_name, '.x.x')))
2728
with:
28-
snapshot: true
29+
security-updates-only: true
2930

30-
release:
31-
uses: ./.github/workflows/release-auto.yml
31+
snapshot:
32+
uses: ./.github/workflows/release.yml
3233
needs: build
3334
secrets: inherit
3435
if: |
3536
needs.build.result == 'success'
3637
&& github.event_name == 'push'
37-
&& github.ref_name == github.event.repository.default_branch
38+
&& (github.ref_name == github.event.repository.default_branch || (startsWith(github.ref_name, 'v') && endsWith(github.ref_name, '.x.x')))
39+
&& needs.release.outputs.released == false
3840
with:
39-
security-updates-only: true
41+
snapshot: true

.github/workflows/release-auto.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ on:
1010
default: false
1111
# Called from build
1212
workflow_call:
13-
inputs:
14-
security-updates-only:
13+
output:
14+
result:
15+
type: string
16+
description: 'Release result'
17+
value: ${{ jobs.check.outputs.release == 'true' && jobs.release.result || 'skipped' }}
18+
released:
1519
type: boolean
16-
required: false
17-
default: false
20+
description: 'Released'
21+
value: ${{ jobs.check.outputs.release == 'true' && jobs.release.result == 'success' }}
1822
schedule:
1923
# at 5:30 UTC every other month
2024
- cron: "30 5 1 */2 *"
@@ -27,7 +31,7 @@ jobs:
2731
security-updates-only: ${{ inputs.security-updates-only }}
2832
debug: true
2933

30-
auto-release:
34+
release:
3135
uses: ./.github/workflows/release.yml
3236
secrets: inherit
3337
if: needs.check.outputs.release == 'true'

0 commit comments

Comments
 (0)