File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11name : CI
22
33on :
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
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
You can’t perform that action at this time.
0 commit comments