release #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
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 | |
checks: none | |
contents: write | |
deployments: none | |
issues: none | |
packages: none | |
pull-requests: none | |
repository-projects: none | |
security-events: none | |
statuses: none | |
jobs: | |
release: | |
environment: Release | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Ref is required for post release version increment commit | |
ref: ${{ github.event.ref }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- run: python ./ci-scripts/getVersion.py | |
id: getVersion | |
- run: ./gradlew publishPlugins --validate-only | |
env: | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
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 |