[Releasing new version]prepare release 1.0.2 #34
Workflow file for this run
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: Prepare version for next release and create tag | |
on: | |
push: | |
branches: | |
- 'release' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.LOGCHANGE_PAT_TOKEN }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
token: ${{ secrets.LOGCHANGE_PAT_TOKEN }} | |
- name: Release and Generate CHANGELOG | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
run: mvn dev.logchange:logchange-maven-plugin:release --non-recursive | |
- name: Set up Git | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
run: git config --global user.name hofund-bot && git config --global user.email [email protected] | |
- name: Commit generated CHANGELOG | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
run: git status && git add ./changelog/ && git commit -am "[ci skip] Generated CHANGELOG.md and prepare version for next release" || echo "Nothing to commit" | |
- name: Push generated CHANGELOG | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
run: git push | |
- name: Git status | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
run: git status | |
# Worth reading regarding GITHUB TOKEN | |
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow | |
- name: Java Maven release | |
uses: qcastel/[email protected] | |
if: "!contains(github.event.head_commit.message, 'Releasing new version')" | |
with: | |
# Cannot use GITHUB_TOKEN because of: | |
# https://github.com/orgs/community/discussions/27028 | |
access-token: ${{ secrets.LOGCHANGE_PAT_TOKEN }} | |
release-branch-name: "release" | |
version-minor: true | |
skip-perform: true | |
git-skip-sanity-check: true | |
env: | |
JAVA_HOME: /usr/lib/jvm/java-21-openjdk/ | |
- name: pull-request | |
uses: repo-sync/pull-request@v2 | |
if: "contains(github.event.head_commit.message, 'prepare for next development iteration')" | |
with: | |
destination_branch: "master" | |
github_token: ${{ secrets.LOGCHANGE_PAT_TOKEN }} | |
pr_title: "release to main - preparation for next development cycle" | |
pr_body: "Autogenerated PR" | |
pr_allow_empty: true | |
pr_assignee: "marwin1991" |