.github/workflows/release_workflow.yml #5
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 and publish | |
on: | |
workflow_dispatch: | |
inputs: | |
project-dir: | |
default: '' | |
required: true | |
description: 'was ist das projekt directory' | |
branch: | |
description: "Branch to release from ?" | |
required: true | |
default: "main" | |
release-version: | |
description: "Release version ?" | |
required: true | |
release-tag: | |
description: "Release tag ?" | |
required: true | |
development-version: | |
description: "Next Development version ?" | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- name: Setup git user | |
uses: fregante/setup-git-user@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
- name: Set release version | |
run: mvn versions:set versions:commit -D ${{ github.event.inputs.release-version }} -f ${{ github.event.inputs.project-dir }}/pom.xml | |
- name: commit release version | |
uses: EndBug/add-and-commit@v9 | |
with: | |
tag: ${{ github.event.inputs.release-tag }} | |
message: Build release version ${{ github.event.inputs.release-version }} | |
add: ${{ github.event.inputs.project-dir }}/**/pom.xml | |
tag_push: "--force" | |
# - name: Create GitHub Release | |
# id: create_release | |
# uses: softprops/action-gh-release@v1 | |
# with: | |
# tag_name: ${{ github.event.inputs.release-tag }} | |
# draft: false | |
# prerelease: false | |
# generate_release_notes: true | |
# | |
# - name: Publish package | |
# run: mvn --batch-mode -f ${{ github.event.inputs.project-dir }}/pom.xml deploy | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set new development version | |
run: mvn versions:set versions:commit -D ${{ github.event.inputs.development-version }} -f ${{ github.event.inputs.project-dir }}/pom.xml | |
- name: commit development version | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: Build next development version ${{ github.event.inputs.development-version }} | |
add: ${{ github.event.inputs.project-dir }}/**/pom.xml |