Skip to content

Commit

Permalink
[CD] Update release workflow to allow modular releases (selectable Gr…
Browse files Browse the repository at this point in the history
…adle/GitHub/Version increment)
  • Loading branch information
ViliusSutkus89 committed Aug 26, 2024
1 parent 6c1ee44 commit 45fdb68
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
name: release
on:
workflow_dispatch:
inputs:
gradle_publish:
description: Publish to Sonatype
type: boolean
default: true
github_release:
description: Create a GitHub release
type: boolean
default: true
version_increment:
description: Increment version
type: boolean
default: true

permissions:
actions: none
Expand Down Expand Up @@ -69,6 +82,7 @@ jobs:
- run: ./gradlew lintRelease publishToMavenLocal

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

- name: Create GitHub Release
if: ${{ github.event.inputs.github_release == 'true' }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -95,12 +110,14 @@ jobs:
id: postReleaseVersionIncrement

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

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

0 comments on commit 45fdb68

Please sign in to comment.