Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -665,3 +665,6 @@ jobs:

- name: Run linter
run: scripts/format-changelogs.sh || git diff --exit-code

- name: Check if changelogs need a bump
run: scripts/bump-changelogs.sh || git diff --exit-code
4 changes: 0 additions & 4 deletions libs/small-steps/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Version history for `small-steps`

## 1.1.2.1

*

Comment on lines -3 to -6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this section is not correct. So, this change is here to test whether this new CI check works correctly or not, right?

## 1.1.2.0

* Add `whenFailureFreeDefault`
Expand Down
37 changes: 23 additions & 14 deletions scripts/bump-changelogs.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#!/usr/bin/env bash

CHAP=./cardano-haskell-packages
# Download a shallow copy of CHaP
git clone --depth 1 [email protected]:IntersectMBO/cardano-haskell-packages.git $CHAP

cd $CHAP || exit
# Save all the available packages from CHaP
CHAP_PACKAGES=$(./scripts/list-packages.sh)
cd - || exit
echo "The following packages are available in CHaP:"
CHAP_PACKAGES=$(mktemp)
trap 'rm -f "$CHAP_PACKAGES"' EXIT

if tar --version | grep -q 'GNU tar'
then
tar () { command tar --wildcards "$@"; }
fi

curl -sSL https://chap.intersectmbo.org/01-index.tar.gz |
tar -tz \*.cabal |
cut -d/ -f1-2 |
LANG=C sort -t/ -k1,1 -k2,2Vr |
LANG=C sort -t/ -k1,1 -u -o "$CHAP_PACKAGES"
echo "The complete CHaP package index is here:"
echo "$CHAP_PACKAGES"

# Save the paths to every `cardano-ledger` cabal file
CABAL_FILES=$(find . -wholename '*/eras/*.cabal' -o -wholename '*/libs/*.cabal')
CABAL_FILES=$(git ls-files '*.cabal')

for i in $CABAL_FILES;
do
Expand All @@ -29,7 +35,7 @@ do
# Check if the package had a release with
# the most recent `CHANGELOG` version number
printf "Looking for %s with version %s in CHaP\n" "$PACKAGE" "$VERSION"
RESULT=$(echo "$CHAP_PACKAGES" | grep -o "$PACKAGE $VERSION")
RESULT=$(grep -o "$PACKAGE/$VERSION" "$CHAP_PACKAGES")
if [[ -n "$RESULT" ]]; then
# A release was found and thus the `CHANGELOG` has to be bumped
# with the incremented patch version
Expand All @@ -40,7 +46,10 @@ do
fi
done

rm -rf $CHAP
printf "\n!!!!!!\n%s %s\n!!!!!!\n" \
"WARNING! DO NOT BUMP THE VERSION NUMBER IN THE CABAL FILES" \
"(unless its dependencies were bumped)!"
set -euo pipefail

if ! git diff -s --exit-code; then
printf "\n!!!!!!\n%s %s\n!!!!!!\n" \
"WARNING! DO NOT BUMP THE VERSION NUMBER IN THE CABAL FILES" \
"(unless their dependencies were bumped)!"
fi