Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jardo-51 committed Apr 7, 2024
2 parents 7bec1ab + 2c5724e commit 43f01d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/assert-project-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

pomFile=$1
expectedVersion=$2

projectVersion=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout --file ${pomFile})
if [[ $projectVersion == "${expectedVersion}" ]]; then
echo "Version is correct: '${expectedVersion}'"
else
echo "Bad version! Expected '${expectedVersion}' but was '$projectVersion'"
exit 1
fi
14 changes: 2 additions & 12 deletions .github/workflows/test-current-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ jobs:
pom-file: "non-branch-version-pom.xml"

- name: Assert version unchanged
run: |
projectVersion=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout --file non-branch-version-pom.xml)
if [[ $projectVersion != "1.0.0" ]]; then
echo "Bad version! Expected '1.0.0' but was '$projectVersion'"
exit 1
fi
run: .github/workflows/assert-project-version.sh non-branch-version-pom.xml 1.0.0

- name: Assert dependency version unchanged
run: .github/workflows/assert-dependency-version.sh non-branch-version-pom.xml com.jardoapps.maven-flow dummy-dependency 1.0.0
Expand All @@ -75,12 +70,7 @@ jobs:
pom-file: "branch-version-pom.xml"

- name: Assert version changed
run: |
projectVersion=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout --file branch-version-pom.xml)
if [[ $projectVersion != "1.0.1-SNAPSHOT" ]]; then
echo "Bad version! Expected '1.0.1-SNAPSHOT' but was '$projectVersion'"
exit 1
fi
run: .github/workflows/assert-project-version.sh branch-version-pom.xml 1.0.1-SNAPSHOT

- name: Assert dependency version changed
run: .github/workflows/assert-dependency-version.sh branch-version-pom.xml com.jardoapps.maven-flow dummy-dependency 1.0.1-SNAPSHOT

0 comments on commit 43f01d1

Please sign in to comment.