Skip to content

Commit

Permalink
Add tagging Makefile target that reads _version.py automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadchaar committed Oct 8, 2023
1 parent ec53161 commit 767c769
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: auto test docs clean
.PHONY: auto test docs clean tag

auto: build311

Expand Down Expand Up @@ -57,3 +57,13 @@ clean-docs:
clean: clean-env clean-dist clean-docs
rm -rf .pytest_cache ./**/__pycache__ .mypy_cache
rm -f .coverage coverage.xml ./**/*.pyc

tag:
@read -p "Has __version__ been updated for release? (Y/N): " choice; \
if [ "$$(echo "$$choice" | tr '[:upper:]' '[:lower:]')" = "y" ]; then \
TAG_VERSION=$$(grep -oE '([0-9]+\.[0-9]+\.[0-9]+)' sec_edgar_downloader/_version.py); \
echo "Creating and pushing Git tag for v$$TAG_VERSION"; \
git tag $$TAG_VERSION master; \
else \
echo "Aborting."; \
fi
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ In order to create a new release, complete the following steps:
1. Outline changes made in the new release in ``CHANGELOG.md``.
2. Bump the version in ``_version.py`` and push change to master branch.
3. Ensure all unit and integration tests pass locally and in the GitHub Actions testing workflow.
4. Create a tag with the same version number specified in ``_version.py``. For example, if you are releasing v5.0.1, run the following to create and push a single tag: ``git tag 5.0.1 master && git push origin 5.0.1``.
4. Create and push tags for the latest version specified in ``_version.py`` by running ``make tag``.
5. Once the tag is pushed, a `GitHub Actions release workflow <https://github.com/jadchaar/sec-edgar-downloader/actions/workflows/release.yml>`_ will be kicked off that automatically creates the package artifacts and uploads them to PyPI.
6. Create a new version based off of the published tag on the `GitHub repository's release page <https://github.com/jadchaar/sec-edgar-downloader/releases>`_.

Expand Down

0 comments on commit 767c769

Please sign in to comment.