Skip to content

Commit d599c8a

Browse files
Update release workflow to allow skipping sonatype, github release or version increment
1 parent d03d3e8 commit d599c8a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
name: release
2424
on:
2525
workflow_dispatch:
26+
inputs:
27+
gradle_publish:
28+
description: Publish to gradle
29+
type: boolean
30+
default: true
31+
github_release:
32+
description: Create a GitHub release
33+
type: boolean
34+
default: true
35+
version_increment:
36+
description: Increment version
37+
type: boolean
38+
default: true
2639

2740
permissions:
2841
actions: none
@@ -69,6 +82,7 @@ jobs:
6982
- run: ./gradlew lintRelease publishToMavenLocal
7083

7184
- run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-configuration-cache
85+
if: ${{ github.event.inputs.gradle_publish == 'true' }}
7286
env:
7387
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
7488
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
@@ -84,6 +98,7 @@ jobs:
8498
file_pattern: ${{ steps.updateDownstreamVersion.outputs.files }}
8599

86100
- name: Create GitHub Release
101+
if: ${{ github.event.inputs.github_release == 'true' }}
87102
uses: ncipollo/release-action@v1
88103
with:
89104
token: ${{ secrets.GITHUB_TOKEN }}
@@ -96,12 +111,14 @@ jobs:
96111
id: postReleaseVersionIncrement
97112

98113
- uses: stefanzweifel/git-auto-commit-action@v5
114+
if: ${{ github.event.inputs.version_increment == 'true' }}
99115
with:
100116
commit_message: "Post release library version increment to ${{ steps.postReleaseVersionIncrement.outputs.newVersion }} (from ${{ steps.postReleaseVersionIncrement.outputs.oldVersion }})"
101117
file_pattern: ${{ steps.postReleaseVersionIncrement.outputs.files }}
102118

103119
- run: echo -n > UpcomingReleaseNotes.md
104120
- uses: stefanzweifel/git-auto-commit-action@v5
121+
if: ${{ github.event.inputs.github_release == 'true' }}
105122
with:
106123
commit_message: "Post release truncation of UpcomingReleaseNotes.md"
107124
file_pattern: UpcomingReleaseNotes.md

0 commit comments

Comments
 (0)