From ddfc9ef6ed13d18fdb9795679691a5dff784e246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Wed, 5 Nov 2025 06:32:40 +0000 Subject: [PATCH] Add release step to GitHub Maven workflow Create a GitHub release with generated notes on tags Also set the permissions for the build step --- .github/workflows/maven.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 834a2cdbc..f90ea70ca 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -9,6 +9,8 @@ on: jobs: build: + permissions: + contents: read strategy: matrix: java: [8, 11, 17, 21] @@ -66,3 +68,15 @@ jobs: cache: 'maven' - name: Build run: mvn ${{ env.maven_commands }} + release: + permissions: + contents: write + needs: build + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create a GitHub release + run: gh release create --generate-notes "${GITHUB_REF#refs/tags/}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}