Skip to content

Commit 1fef763

Browse files
committed
Make releases require manual CI trigger
Rather than automatically running when a new version is detected
1 parent 97d1308 commit 1fef763

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CI
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
@@ -54,12 +55,15 @@ jobs:
5455
shell: bash
5556
run: git show-ref --tags --verify --quiet -- "refs/tags/${{ env.PROJECT_VERSION }}" && echo "tagExists=1" >> $GITHUB_OUTPUT || echo "tagExists=0" >> $GITHUB_OUTPUT
5657

57-
# Run tests & build artifact
58+
# Run build.
59+
# Either the tag exists, or the trigger was not a manual one.
60+
# Without explicit intent we do not want to publish a release.
5861
- name: Build
59-
if: steps.tagged.outputs.tagExists == 1
62+
if: steps.tagged.outputs.tagExists == 1 || github.event_name != 'workflow_dispatch'
6063
run: ./mvnw test
64+
# Tag does not exist AND trigger was manual. Deploy release artifacts!
6165
- name: Build release
62-
if: steps.tagged.outputs.tagExists == 0
66+
if: steps.tagged.outputs.tagExists == 0 && github.event_name == 'workflow_dispatch'
6367
run: ./mvnw deploy -Prelease -DaltDeploymentRepository=local::default::file:./target/staging-deploy
6468

6569
# Upload test results
@@ -75,7 +79,7 @@ jobs:
7579
7680
# Make release with JReleaser, only running when the project version does not exist as a tag on the repository.
7781
- name: Release
78-
if: steps.tagged.outputs.tagExists == 0
82+
if: steps.tagged.outputs.tagExists == 0 && github.event_name == 'workflow_dispatch'
7983
uses: jreleaser/release-action@v2
8084
with:
8185
arguments: full-release

0 commit comments

Comments
 (0)