Skip to content

Commit 76cfcb9

Browse files
committed
Tighten up several checks.
1 parent 3264a53 commit 76cfcb9

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="aws_doc_sdk_examples_tools",
8-
version="2024.40.2",
8+
version="2024.40.0",
99
packages=["aws_doc_sdk_examples_tools"],
1010
package_data={"aws_doc_sdk_examples_tools": ["config/*.yaml"]},
1111
entry_points={

stamp.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,26 @@ if [ -n "${STATUS}" ] ; then
1717
# exit 1
1818
fi
1919

20-
# VERSION and DATE have the format YYYY.WW.REV, where YYYY is the current year,
20+
# And check that the REMOTE points to the -tools repo.
21+
REMOTE="${REMOTE:origin}"
22+
if [ "$(git remote get-url $REMOTE 2>/dev/null)" != "[email protected]:awsdocs/aws-doc-sdk-examples-tools.git" ] ; then
23+
echo "REMOTE=${REMOTE} is not set to [email protected]:awsdocs/aws-doc-sdk-examples-tools.git, please adjust accordingly and rerun."
24+
exit 1
25+
fi
26+
27+
# CURRENT and NEXT have the format YYYY.WW.REV, where YYYY is the current year,
2128
# WW is the current week, and REV is the number of releases this week.
2229
# The next revision compares the two, in this way
23-
# - If DATE is later than VERSION in all fields, accept date.
24-
# - Otherwise, return VERSION, with one added to REV.
30+
# - If NEXT is later than CURRENT in any fields, accept NEXT.
31+
# - Otherwise, return CURRENT, with one added to REV.
2532
#
2633
# THIS FUNCTION IS NOT TRANSITIVE! It must be called with
2734
# `compare_versions CURRENT NEXT`
2835
compare_versions() {
29-
IFS='.' read -r y1 w1 r1 <<< "$1"
30-
IFS='.' read -r y2 w2 r2 <<< "$2"
31-
32-
if [ "$y1" -lt "$y2" ] || \
33-
[ "$w1" -lt "$w2" ] || \
34-
[ "$r1" -lt "$r2" ]; then
36+
if [[ "$1" < "$2" ]] ; then
3537
echo "$2"
3638
else
39+
IFS='.' read -r y1 w1 r1 <<< "$1"
3740
r1=$((r1 + 1))
3841
echo "${y1}.${w1}.${r1}"
3942
fi
@@ -53,7 +56,7 @@ git add setup.py
5356
git commit --message "Release ${VERSION}"
5457

5558
if [ "$1" == "--release" ] ; then
56-
git tag $VERSION main
57-
git push origin $VERSION
58-
git push origin main
59+
git tag "$VERSION" main
60+
git push "$REMOTE" "$VERSION"
61+
git push "$REMOTE" main
5962
fi

0 commit comments

Comments
 (0)