2021-05-09 19:34:36 +02:00
|
|
|
name: Release
|
2021-05-07 23:50:44 +02:00
|
|
|
|
|
|
|
on:
|
2021-05-09 19:30:24 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
releaseVersion:
|
|
|
|
description: "Default version to use when preparing a release."
|
|
|
|
required: true
|
|
|
|
default: "X.Y.Z"
|
|
|
|
developmentVersion:
|
|
|
|
description: "Default version to use for new local working copy."
|
|
|
|
required: true
|
|
|
|
default: "X.Y.Z-SNAPSHOT"
|
2021-05-07 23:50:44 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-05-09 19:34:36 +02:00
|
|
|
release:
|
2021-05-07 23:50:44 +02:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-05-09 22:37:09 +02:00
|
|
|
- name: Checkout
|
2023-09-04 14:57:12 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-05-09 19:30:24 +02:00
|
|
|
- name: Configure Git User
|
|
|
|
run: |
|
|
|
|
git config user.email "actions@github.com"
|
|
|
|
git config user.name "GitHub Actions"
|
2023-06-29 22:21:37 +02:00
|
|
|
- name: Set up JDK 17
|
2022-04-11 14:23:33 +02:00
|
|
|
uses: actions/setup-java@v3
|
2021-05-07 23:50:44 +02:00
|
|
|
with:
|
2022-04-20 23:53:28 +02:00
|
|
|
distribution: 'temurin'
|
2023-06-29 22:21:37 +02:00
|
|
|
java-version: 17
|
2022-04-20 23:53:28 +02:00
|
|
|
cache: 'maven'
|
2021-05-09 22:37:09 +02:00
|
|
|
- name: Release to GitHub packages
|
2021-05-09 23:03:38 +02:00
|
|
|
run: |
|
2021-12-11 19:52:07 +01:00
|
|
|
mvn -B clean release:prepare release:perform -s maven-github-settings.xml --file pom.xml -DpushChanges=false -DlocalCheckout=true -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
|
2021-05-09 23:03:38 +02:00
|
|
|
git push origin v${{ github.event.inputs.releaseVersion }}
|
2021-05-09 22:56:30 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
2021-05-09 22:37:09 +02:00
|
|
|
- name: Release to GitHub releases
|
2021-05-08 00:06:46 +02:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2021-05-09 22:37:09 +02:00
|
|
|
files: "target/keycloak-restrict-client-auth.jar"
|
2021-09-30 21:10:12 +02:00
|
|
|
body_path: "RELEASELOG.md"
|
2021-05-09 23:20:50 +02:00
|
|
|
fail_on_unmatched_files: true
|
|
|
|
tag_name: v${{ github.event.inputs.releaseVersion }}
|
2023-03-11 00:41:32 +01:00
|
|
|
generate_release_notes: true
|
2021-05-08 00:06:46 +02:00
|
|
|
env:
|
2021-05-09 22:56:30 +02:00
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
2021-05-09 22:37:09 +02:00
|
|
|
- name: Create Pull Request
|
|
|
|
id: create-pr
|
2023-04-10 14:57:22 +02:00
|
|
|
uses: peter-evans/create-pull-request@v5
|
2021-05-09 22:37:09 +02:00
|
|
|
with:
|
|
|
|
commit-message: "chore(release): Prepare next version"
|
|
|
|
delete-branch: "true"
|
|
|
|
branch: "release/${{ github.event.inputs.releaseVersion }}"
|
|
|
|
base: "main"
|
|
|
|
title: "chore(release): Prepare next version after release ${{ github.event.inputs.releaseVersion }}"
|
|
|
|
body: "Automated PR to prepare next version after release ${{ github.event.inputs.releaseVersion }}"
|
2023-03-11 00:41:32 +01:00
|
|
|
labels: "release,ignore-for-release"
|
2021-05-09 22:37:09 +02:00
|
|
|
assignees: "sventorben"
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|