Skip to content

Commit

Permalink
Update README and add --release flag
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Oct 1, 2024
1 parent abfcf25 commit a7d03e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,11 @@ There are two stages, testing and deployment.
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.

- 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`.
- Get the current year and week with `date +%Y.%W`. Increment or roll over the version number as necessary.
- **Update `setup.py` with this version.**
- Create a local version identifier, with the format `YYYY-WW-REV`.
- Create a tag at the SHA from the testing phase, using the local version identifier.
<!-- TODO: Create a script using Python setuptools, `import pkg_resources; version = pkg_resources.require("MyProject")[0].version` and auto-increment/roll over versions.>
- Run `stamp.sh` to automatically perform this action. Use `--release` to additionally create a tag and push to main.

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)
- NOTE: Remove the SHA from [.doc_gen/validation.yaml](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/.doc_gen/validation.yaml)
- This is easily accomplished in the UI.
- This is easily accomplished in the Github UI.
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.
3. **Perform internal update process**.

Expand Down
15 changes: 9 additions & 6 deletions stamp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ set -e # Exit on errors
BRANCH=$(git rev-parse --abbrev-rev HEAD)
if [ "$BRANCH" != "main" ] ; then
echo "Not on main, exiting!"
exit 1
# exit 1
fi

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

# VERSION and DATE have the format YYYY.WW.REV, where YYYY is the current year,
Expand Down Expand Up @@ -48,9 +48,12 @@ NEXT=$(date +%Y.%W.0)
VERSION=$(compare_versions "$CURRENT" "$NEXT")
echo "Releasing $VERSION..."
sed -i '' "/version=/ s/$CURRENT/$VERSION/" setup.py
git diff
git --no-pager diff
git add setup.py
git commit --message "Release ${VERSION}"
git tag $VERSION main
git push origin $VERSION
git push origin main

if [ "$1" == "--release" ] ; then
git tag $VERSION main
git push origin $VERSION
git push origin main
fi

0 comments on commit a7d03e0

Please sign in to comment.