Skip to content

Commit

Permalink
Merge #4355
Browse files Browse the repository at this point in the history
4355: Use `git show` instead in consensus-changelog check r=Jasagredo a=Jasagredo



Co-authored-by: Javier Sagredo <javier.sagredo@iohk.io>
  • Loading branch information
iohk-bors[bot] and jasagredo committed Feb 10, 2023
2 parents 15139f6 + dbb7cf9 commit 4ad75c4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/ci/check-consensus-release.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
#!/usr/bin/env bash

# For each one of the two bundles, check that:
# (1) if the version in the cabal file was changed in any of the packages
# (1) if the version in the cabal file was changed in any of the packages wrt the latest version described in the changelog
# (2) then it was changed on all of them
# (3) and to the same value
# (4) and also there are no remaining changelog entries
# otherwise exits with exit code 1

cardano_packages=$(find . -maxdepth 1 -type d -name "ouroboros-consensus-cardano*" -or -name "ouroboros-consensus-shelley*" -or -name "ouroboros-consensus-byron*")
cardano_last_version=$(grep "<a id=" ouroboros-consensus-cardano/CHANGELOG.md | cut -d\' -f2 | cut -d- -f2)
cardano_versions=$(for f in $cardano_packages; do
git diff $(ls $f/*.cabal) | grep "+version"
git show $(ls $f/*.cabal) | grep "+version" | rev | cut -d' ' -f1 | rev
done)

consensus_packages=$(find . -maxdepth 1 -type d -name "ouroboros-consensus*" -not -name "*byron*" -not -name "*shelley*" -not -name "*cardano*")
consensus_last_version=$(grep "<a id=" ouroboros-consensus/CHANGELOG.md | cut -d\' -f2 | cut -d- -f2)
consensus_versions=$(for f in $consensus_packages; do
git diff $(ls $f/*.cabal) | grep "+version"
git show $(ls $f/*.cabal) | grep "+version" | rev | cut -d' ' -f1 | rev
done)

if [ -z "$consensus_versions" ]; then # See (1) above
if [ $(echo "$consensus_versions" | tr ' ' '\n' | sort | uniq) == "$consensus_last_version" ]; then # See (1) above
echo "ouroboros-consensus version not updated"
else
if [ $(echo "$consensus_versions" | wc -l) != $(echo "$consensus_packages" | wc -l) ]; then # See (2) above
Expand All @@ -39,7 +41,8 @@ else
fi


if [ -z "$cardano_versions" ]; then # See (1) above
# Cardano didn't have a first version when this was released, that's why there is that default value
if [ $(echo "$cardano_versions" | tr ' ' '\n' | sort | uniq) == "${cardano_last_version:-0.1.0.0}" ]; then # See (1) above
echo "ouroboros-consensus-cardano version not updated"
else
if [ $(echo "$cardano_versions" | wc -l) != $(echo "$cardano_packages" | wc -l) ]; then # See (2) above
Expand Down

0 comments on commit 4ad75c4

Please sign in to comment.