ci(github-actions): revamp build.yaml to trigger on tags and do proper validation of version
All checks were successful
Build / build (pull_request) Successful in 1m16s

This commit is contained in:
Jorge Bornhausen 2025-07-18 10:26:00 +02:00
parent 1cc8a39c88
commit a5e0c2672b
Signed by: jorge.bornhausen
SSH key fingerprint: SHA256:X2ootOwvCeP4FoNfmVUFIKIbhq95tAgnt7Oqg3x+lfs

View file

@ -4,6 +4,8 @@ on:
push:
branches:
- "main"
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths-ignore:
- '.gitattributes'
- '.gitignore'
@ -12,6 +14,7 @@ on:
- 'docs/**'
- 'README.md'
pull_request:
workflow_dispatch:
env:
COMMON_MAVEN_OPTS: "-e -B --fae"
@ -73,6 +76,17 @@ jobs:
- name: Make maven wrapper executable
run: chmod +x mvnw
- name: Validate tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}"
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ "$PROJECT_VERSION" != "$TAG_NAME" ]]; then
echo "::error::pom.xml version '$PROJECT_VERSION' does not match tag '$TAG_NAME'"
exit 1
fi
- name: Download dependencies
run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline