Skip to content

Commit

Permalink
Automatically update also the full version in docs/conf.py at release…
Browse files Browse the repository at this point in the history
… time

[skip actions]
  • Loading branch information
lelit committed Dec 29, 2023
1 parent 4d28f02 commit c3bad21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 9 additions & 5 deletions Makefile.release
Expand Up @@ -3,13 +3,14 @@
# :Created: gio 03 ago 2017 14:53:18 CEST
# :Author: Lele Gaifax <lele@metapensiero.it>
# :License: GNU General Public License version 3 or later
# :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022 Lele Gaifax
# :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023 Lele Gaifax
#

BUMPER := $(VENVDIR)/bin/bump_version
VERSION_TXT := version.txt
VERSION = $(shell cat $(VERSION_TXT))
MOD_INIT := pglast/__init__.py
DOCS_CONF := docs/conf.py
TWINE := $(VENVDIR)/bin/twine

help::
Expand Down Expand Up @@ -46,18 +47,21 @@ dev-release: $(VENVDIR)/extension.timestamp printers-doc assert-clean-tree
help::
@printf "tag-release\n\tComplete the release tagging the working tree\n"

.PHONY: tag-release
tag-release: check-release-date check-long-description-markup
.PHONY: inject-version
inject-version:
sed -i "s/__version__ = '.*'/__version__ = 'v$(VERSION)'/" $(MOD_INIT)
sed -i "s/release = '.*'/release = 'v$(VERSION)'/" $(DOCS_CONF)

.PHONY: tag-release
tag-release: check-release-date check-long-description-markup inject-version
git commit -a -m "Release $(VERSION)"
git tag -a -m "Version $(VERSION)" v$(VERSION)

help::
@printf "dev-tag-release\n\tComplete the development release tagging the working tree\n"

.PHONY: dev-tag-release
dev-tag-release: check-release-date check-long-description-markup
sed -i "s/__version__ = '.*'/__version__ = 'v$(VERSION)'/" $(MOD_INIT)
dev-tag-release: check-release-date check-long-description-markup inject-version
git commit -a -m "Development release $(VERSION)"
git tag -a -m "Development version $(VERSION)" v$(VERSION)

Expand Down
7 changes: 4 additions & 3 deletions docs/conf.py
Expand Up @@ -47,7 +47,7 @@

# General information about the project.
project = 'pglast'
copyright = '2017, 2018, 2019, 2020, 2021, 2022 Lele Gaifax'
copyright = '2017-2023 Lele Gaifax'
author = 'Lele Gaifax'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -56,8 +56,9 @@
#
# The short X.Y version.
version = '5.0'
# The full version, including alpha/beta/rc tags.
release = '5.0.dev0'
# The full version, including alpha/beta/rc tags: this is injected automatically
# at release time.
release = 'v5.7'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit c3bad21

Please sign in to comment.