Skip to content

Commit e5a4a63

Browse files
committed
Updated release scripts
1 parent 85f8467 commit e5a4a63

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

scripts/build-with-chap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ fi
4545
cabal_files=$(fd -ae 'cabal')
4646
for cf in $cabal_files; do
4747
name=$(cat $cf | grep '^name:' | awk '{ print $2 }')
48-
if [[ -d "$CHAP_DIR/_sources/$name" ]]; then
49-
version=$(ls -1 $CHAP_DIR/_sources/$name | sort -V | tail -1)
48+
version=$(cat $cf | grep '^version:' | awk '{ print $2 }')
49+
if [[ -d "$CHAP_DIR/_sources/$name/$version" ]]; then
5050
rev=$(yq .github.rev $CHAP_DIR/_sources/$name/$version/meta.toml)
5151
git restore --source=$rev -- $name
5252
tb=0
@@ -57,7 +57,7 @@ for cf in $cabal_files; do
5757
cp $revdir/$rev "$name/$name.cabal"
5858
fi
5959
else
60-
echo "WARNING: $name not in cardano-haskell-packages"
60+
echo "WARNING: $name-$version not in cardano-haskell-packages"
6161
fi
6262
done
6363

@@ -82,5 +82,5 @@ fi
8282

8383
pushd $CHAP_DIR
8484
if [[ $TEST == 0 && $(git symbolic-ref --short HEAD) =~ ^dmq-node\/release- ]] then
85-
gh pr comment --body "* [x] checked with \`build-with-chap.sh\` in \`dmq-network\`"
85+
gh pr comment --body "* [x] checked with \`build-with-chap.sh\` in \`dmq-node`"
8686
fi

scripts/release-to-chap.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,27 @@ else
8181
git switch main
8282
git pull
8383
fi
84-
BRANCH="dmq-node/release-$(date -I)"
84+
BRANCH="dmq-node/release-$(date +%Y%m%d-%H%m%S)"
8585
if [[ $TEST == 1 ]];then
8686
BRANCH="${BRANCH}-DO_NOT_MERGE"
8787
fi
8888
git switch -c $BRANCH
8989

90+
# Gather packages to publish on CHaP
91+
publish=""
9092
for cf in $cabal_files; do
9193
name=$(cat $cf | grep '^name:' | awk '{ print $2 }')
9294
version=$(cat $cf | grep '^version:' | awk '{ print $2 }')
9395
dir="$CHAP_DIR/_sources/$name/$version"
9496
if [[ !(-d $dir) ]];then
95-
trace "publishing $name-$version"
96-
./scripts/add-from-github.sh $REPO_URL $gitsha $name
97+
publish="$publish $name"
9798
if [[ $TEST == 0 ]];then
9899
git --git-dir "$gitdir/.git" tag "$name-$version" $gitsha
99100
fi
100101
fi
101102
done
103+
trace "Publishing:$publish"
104+
./scripts/add-from-github.sh $REPO_URL $gitsha $publish
102105

103106
git --no-pager log --oneline origin/main..HEAD
104107

0 commit comments

Comments
 (0)