44
55name : Build RPM
66on : push
7- env :
8- NIGHTLY_BRANCH : develop
7+
98jobs :
109 build-rpm :
1110 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
2322 - name : Install dependencies
2423 run : |
2524 dnf upgrade -y
26- [[ "${{ matrix.version }}" = 8 ]] && dnf module enable -y maven:3.8/common
25+ dnf module enable -y maven:3.8
2726 dnf install -y git rpmdevtools rpmlint maven-openjdk17
2827 - name : Setup build tree
2928 run : |
@@ -41,19 +40,16 @@ jobs:
4140 # Maven uses -SNAPSHOT for pre-releases, change the - to ~ in the RPM
4241 VERSION_RPM=$(echo ${VERSION_POM} | sed 's/-/~/')
4342 if [[ ${{ github.ref_type }} = 'tag' ]]; then
44- # In case is a tag, get the tag value
45- GITHUB_REF=${{ github.ref }}
46- TAG_NAME=${GITHUB_REF#refs/tags/}
47- # Check if the tag matches v<x>.<y>.<z>
48- if [[ ${TAG_NAME} =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
43+ # In case is a tag, check if the tag matches v<x>.<y>.<z>
44+ if [[ ${GITHUB_REF_NAME} =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
4945 REPO='stable'
5046 VERSION="${BASH_REMATCH[1]}"
5147 if [[ ${VERSION} != ${VERSION_POM} ]]; then
5248 echo "Version mismatch between tag (${VERSION}) and POM file (${VERSION_POM})"
5349 exit 1
5450 fi
5551 fi
56- elif [[ ${GITHUB_REF } = "refs/heads/${NIGHTLY_BRANCH}" ]]; then
52+ elif [[ ${GITHUB_REF_NAME } = ${{ github.event.repository.default_branch }} ]]; then
5753 # Check if the version in POM file matches <x>.<y>.<z>-SNAPSHOT
5854 if [[ ${VERSION_POM} =~ ^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$ ]]; then
5955 REPO='nightly'
0 commit comments