Skip to content

Commit

Permalink
Check released version and configured version
Browse files Browse the repository at this point in the history
Recently same version published and caused issues for the downstream applications with checksum changes. Added GitHub step check whether the version configured has been released previously. This will prevent overriding existing releases

Signed-off-by: Chaminda Divitotawela <cdivitotawela@gmail.com>
  • Loading branch information
cdivitotawela committed Jul 29, 2024
1 parent cd4ad11 commit d3ef86e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
# Check whether gradle.properties version has been released already
# This prevents accidently publish same version
# Only check binary for arithmetic as all published together and arithmetic is the first
- name: Check existing release
run: |
# Check whether version contains SNAPSHOT
grep "^version" gradle.properties | grep -q SNAPSHOT || {
# Extract version from gradle.properties
VERSION=$(grep "^version" gradle.properties | sed 's|^version=\(.*\)$|\1|g')
echo "Query for version [$VERSION]"
curl --head -L --silent --output /dev/null --fail "$ART_URL/$VERSION" && {
echo "ERROR: Binary arithmetic already exit for version [$VERSION]"
echo "ERROR: Blocking publishing same version to the Besu Artiactory"
echo "url $ART_URL/$VERSION"
exit 1
}
}
env:
ART_URL: 'https://hyperledger.jfrog.io/artifactory/besu-maven/org/hyperledger/besu/arithmetic'
- name: Build
run: ./build.sh
- uses: actions/upload-artifact@v3.1.0
Expand Down

0 comments on commit d3ef86e

Please sign in to comment.