Skip to content

Commit 1f35b61

Browse files
committed
ci: Update prepare-release.sh to update versions in the Helm chart
1 parent d410afc commit 1f35b61

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

hack/prepare-release.sh

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,19 @@ if [[ ! ($VERSION =~ $VERSION_REGEX) ]]; then
2222
exit 1
2323
fi
2424

25-
VERSION_NO_V=$(echo $VERSION | sed 's/$v//g')
25+
VERSION_NO_V=$(echo $VERSION | sed 's/^v//g')
2626

2727
echo VERSION=$VERSION
2828
echo VERSION_NO_V=$VERSION_NO_V
2929

30+
make manifests
31+
if [ ! -z "$(git status --porcelain)" ]; then
32+
echo "make manifests changes manifests even though we did not touch the version yet!"
33+
exit 1
34+
fi
35+
36+
### A few seds/yqs to update versions
37+
3038
cat docs/install.md | sed "s/ref=$VERSION_REGEX_SED/ref=$VERSION/g" > docs/install.md.tmp
3139
mv docs/install.md.tmp docs/install.md
3240

@@ -44,12 +52,27 @@ for f in $SED_FILES; do
4452
mv $f.tmp $f
4553
done
4654

55+
echo "Updating manifests and docs"
56+
make manifests
57+
make helm-docs
58+
59+
ADD_FILES="$ADD_FILES deploy/manifests/template-controller.yaml"
60+
ADD_FILES="$ADD_FILES deploy/charts/template-controller/README.md"
61+
62+
echo "Adding files to index: $ADD_FILES"
4763
for f in $ADD_FILES; do
4864
git add $f
4965
done
5066

51-
echo "committing"
67+
echo "Committing"
5268
git commit -o -m "build: Preparing release $VERSION" -- $ADD_FILES
5369

54-
echo "tagging"
70+
# Check if working tree got clean after commiting all know changed files. If you see this failing, you might need to
71+
# update the ADD_FILES
72+
if [ ! -z "$(git status --porcelain)" ]; then
73+
echo "make manifests changes manifests even though we did not touch the version yet!"
74+
exit 1
75+
fi
76+
77+
echo "Tagging"
5578
git tag -f $VERSION

0 commit comments

Comments
 (0)