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
All checks were successful
Build / build (pull_request) Successful in 1m16s
This commit is contained in:
parent
1cc8a39c88
commit
a5e0c2672b
1 changed files with 14 additions and 0 deletions
14
.github/workflows/build.yaml
vendored
14
.github/workflows/build.yaml
vendored
|
@ -4,6 +4,8 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
|
tags:
|
||||||
|
- '[0-9]+.[0-9]+.[0-9]+'
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.gitattributes'
|
- '.gitattributes'
|
||||||
- '.gitignore'
|
- '.gitignore'
|
||||||
|
@ -12,6 +14,7 @@ on:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
COMMON_MAVEN_OPTS: "-e -B --fae"
|
COMMON_MAVEN_OPTS: "-e -B --fae"
|
||||||
|
@ -73,6 +76,17 @@ jobs:
|
||||||
- name: Make maven wrapper executable
|
- name: Make maven wrapper executable
|
||||||
run: chmod +x mvnw
|
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
|
- name: Download dependencies
|
||||||
run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline
|
run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue