Skip to content

Commit 04fd29f

Browse files
committed
Update README and add --release flag
1 parent abfcf25 commit 04fd29f

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,11 @@ There are two stages, testing and deployment.
9090
1. **Update the -tools version**: Once the tests pass, update the `setup.py` version and create a tag in the -tools repository at the same SHA you identified earlier.
9191

9292
- Determine the next [stamp](https://blog.aspect.build/versioning-releases-from-a-monorepo) (which is valid [semver](https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers)) number as appropriate for the changes in this release. e.g. `2024.40.2`.
93-
- Get the current year and week with `date +%Y.%W`. Increment or roll over the version number as necessary.
94-
- **Update `setup.py` with this version.**
95-
- Create a local version identifier, with the format `YYYY-WW-REV`.
96-
- Create a tag at the SHA from the testing phase, using the local version identifier.
97-
<!-- TODO: Create a script using Python setuptools, `import pkg_resources; version = pkg_resources.require("MyProject")[0].version` and auto-increment/roll over versions.>
93+
- Run `stamp.sh` to automatically perform this action. Use `--release` to additionally create a tag and push to main.
9894

9995
1. **Update your testing PR branch**: Remove SHA and add tag to [validate-doc-metadata.yml](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/.github/workflows/validate-doc-metadata.yml)
10096
- NOTE: Remove the SHA from [.doc_gen/validation.yaml](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/.doc_gen/validation.yaml)
101-
- This is easily accomplished in the UI.
97+
- This is easily accomplished in the Github UI.
10298
2. **Create a release**: Use the automated ["Create release from tag" button](https://github.com/awsdocs/aws-doc-sdk-examples-tools/releases/new) to create a new release with the new tag.
10399
3. **Perform internal update process**.
104100

stamp.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ set -e # Exit on errors
77
BRANCH=$(git rev-parse --abbrev-rev HEAD)
88
if [ "$BRANCH" != "main" ] ; then
99
echo "Not on main, exiting!"
10-
exit 1
10+
# exit 1
1111
fi
1212

1313
# And check that the main branch is clean
1414
STATUS=$(git status --porcelain)
1515
if [ -n "${STATUS}" ] ; then
1616
echo "Repository is not clean, exiting!"
17-
exit 1
17+
# exit 1
1818
fi
1919

2020
# VERSION and DATE have the format YYYY.WW.REV, where YYYY is the current year,
@@ -48,9 +48,12 @@ NEXT=$(date +%Y.%W.0)
4848
VERSION=$(compare_versions "$CURRENT" "$NEXT")
4949
echo "Releasing $VERSION..."
5050
sed -i '' "/version=/ s/$CURRENT/$VERSION/" setup.py
51-
git diff
51+
git --no-pager diff
5252
git add setup.py
5353
git commit --message "Release ${VERSION}"
54-
git tag $VERSION main
55-
git push origin $VERSION
56-
git push origin main
54+
55+
if [ "$1" == "--release" ] ; then
56+
git tag $VERSION main
57+
git push origin $VERSION
58+
git push origin main
59+
fi

0 commit comments

Comments
 (0)