Skip to content

Commit

Permalink
[CD] Updateallow enabling/disabling gradle publish, github release an…
Browse files Browse the repository at this point in the history
…d version increment
  • Loading branch information
ViliusSutkus89 committed Jul 28, 2024
1 parent 7f04829 commit 320fac7
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
name: release
on: workflow_dispatch
on:
workflow_dispatch:
inputs:
gradle_publish:
description: Publish to gradle
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 @@ -36,28 +50,34 @@ jobs:
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}

- run: ./gradlew publishPlugins
if: ${{ github.event.inputs.gradle_publish == 'true' }}
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}

- name: Create GitHub Release
uses: ncipollo/release-action@v1
if: ${{ github.event.inputs.github_release == 'true' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: "v${{ steps.getVersion.outputs.version }}"
name: "${{ github.event.repository.name }} v${{ steps.getVersion.outputs.version }}"
bodyFile: "UpcomingReleaseNotes.md"

- run: python ./ci-scripts/incrementVersion.py
if: ${{ github.event.inputs.version_increment == 'true' }}
id: postReleaseVersionIncrement

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

- run: echo -n > UpcomingReleaseNotes.md
if: ${{ github.event.inputs.github_release == 'true' }}
- 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 320fac7

Please sign in to comment.