Merge pull request 'ci(github-actions): revamp build.yaml to trigger on tags and do proper validation of version' (#96) from build into main
All checks were successful
Build / build (push) Successful in 2m7s
All checks were successful
Build / build (push) Successful in 2m7s
Reviewed-on: #96
This commit is contained in:
commit
f6e85f2c00
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:
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue