python-semantic-release 9.1.1__tar.gz → 9.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python-semantic-release-9.2.0/MANIFEST.in +9 -0
- {python-semantic-release-9.1.1/python_semantic_release.egg-info → python-semantic-release-9.2.0}/PKG-INFO +2 -1
- python-semantic-release-9.2.0/docs/Makefile +183 -0
- python-semantic-release-9.2.0/docs/algorithm.rst +205 -0
- python-semantic-release-9.2.0/docs/automatic-releases/cronjobs.rst +41 -0
- python-semantic-release-9.2.0/docs/automatic-releases/github-actions.rst +104 -0
- python-semantic-release-9.2.0/docs/automatic-releases/index.rst +26 -0
- python-semantic-release-9.2.0/docs/automatic-releases/travis.rst +53 -0
- python-semantic-release-9.2.0/docs/changelog_templates.rst +340 -0
- python-semantic-release-9.2.0/docs/commands.rst +423 -0
- python-semantic-release-9.2.0/docs/commit-parsing.rst +361 -0
- python-semantic-release-9.2.0/docs/conf.py +94 -0
- python-semantic-release-9.2.0/docs/configuration.rst +683 -0
- python-semantic-release-9.2.0/docs/contributing.rst +1 -0
- python-semantic-release-9.2.0/docs/contributors.rst +1 -0
- python-semantic-release-9.2.0/docs/github-action.rst +134 -0
- python-semantic-release-9.2.0/docs/index.rst +192 -0
- python-semantic-release-9.2.0/docs/make.bat +242 -0
- python-semantic-release-9.2.0/docs/migrating_from_v7.rst +628 -0
- python-semantic-release-9.2.0/docs/multibranch_releases.rst +167 -0
- python-semantic-release-9.2.0/docs/strict_mode.rst +72 -0
- python-semantic-release-9.2.0/docs/troubleshooting.rst +39 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/pyproject.toml +2 -1
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0/python_semantic_release.egg-info}/PKG-INFO +2 -1
- python-semantic-release-9.2.0/python_semantic_release.egg-info/SOURCES.txt +144 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/python_semantic_release.egg-info/requires.txt +1 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/__init__.py +1 -1
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/changelog/release_history.py +6 -2
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/commands/changelog.py +2 -2
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/commands/version.py +51 -6
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/common.py +5 -3
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/config.py +3 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/util.py +1 -1
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/version/algorithm.py +26 -14
- python-semantic-release-9.2.0/tests/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/command_line/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/command_line/conftest.py +98 -0
- python-semantic-release-9.2.0/tests/command_line/test_changelog.py +312 -0
- python-semantic-release-9.2.0/tests/command_line/test_generate_config.py +61 -0
- python-semantic-release-9.2.0/tests/command_line/test_help.py +21 -0
- python-semantic-release-9.2.0/tests/command_line/test_main.py +170 -0
- python-semantic-release-9.2.0/tests/command_line/test_publish.py +37 -0
- python-semantic-release-9.2.0/tests/command_line/test_version.py +797 -0
- python-semantic-release-9.2.0/tests/conftest.py +39 -0
- python-semantic-release-9.2.0/tests/const.py +330 -0
- python-semantic-release-9.2.0/tests/fixtures/__init__.py +5 -0
- python-semantic-release-9.2.0/tests/fixtures/commit_parsers.py +39 -0
- python-semantic-release-9.2.0/tests/fixtures/example_project.py +391 -0
- python-semantic-release-9.2.0/tests/fixtures/git_repo.py +391 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/__init__.py +3 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/git_flow/__init__.py +2 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +521 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +547 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/github_flow/__init__.py +1 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/github_flow/repo_w_release_channels.py +398 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/trunk_based_dev/__init__.py +3 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +283 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +352 -0
- python-semantic-release-9.2.0/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +286 -0
- python-semantic-release-9.2.0/tests/fixtures/scipy.py +163 -0
- python-semantic-release-9.2.0/tests/scenario/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/scenario/test_next_version.py +2616 -0
- python-semantic-release-9.2.0/tests/scenario/test_release_history.py +353 -0
- python-semantic-release-9.2.0/tests/scenario/test_template_render.py +177 -0
- python-semantic-release-9.2.0/tests/unit/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/changelog/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/changelog/test_default_changelog.py +189 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/changelog/test_release_notes.py +112 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/changelog/test_template.py +58 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/cli/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/cli/test_config.py +165 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/cli/test_github_actions_output.py +66 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/cli/test_masking_filter.py +233 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/cli/test_util.py +202 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/cli/test_version.py +23 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/helper.py +5 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/test_angular.py +183 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/test_emoji.py +85 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/test_scipy.py +13 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/test_tag.py +74 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/test_token.py +22 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/commit_parser/test_util.py +26 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test__base.py +49 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test_bitbucket.py +169 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test_gitea.py +636 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test_github.py +735 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test_gitlab.py +409 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test_token_auth.py +43 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/test_helpers.py +124 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/version/__init__.py +0 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/version/test_algorithm.py +397 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/version/test_declaration.py +133 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/version/test_translator.py +97 -0
- python-semantic-release-9.2.0/tests/unit/semantic_release/version/test_version.py +331 -0
- python-semantic-release-9.2.0/tests/util.py +195 -0
- python-semantic-release-9.1.1/MANIFEST.in +0 -3
- python-semantic-release-9.1.1/python_semantic_release.egg-info/SOURCES.txt +0 -57
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/AUTHORS.rst +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/LICENSE +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/README.rst +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/python_semantic_release.egg-info/top_level.txt +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/__main__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/changelog/__init__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/changelog/context.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/changelog/template.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/__init__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/commands/__init__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/commands/generate_config.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/commands/main.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/commands/publish.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/const.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/github_actions_output.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/masking_filter.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/cli/util.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/__init__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/_base.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/angular.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/emoji.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/scipy.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/tag.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/commit_parser/token.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/const.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/data/templates/release_notes.md.j2 +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/enums.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/errors.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/helpers.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/__init__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/_base.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/bitbucket.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/gitea.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/github.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/gitlab.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/token_auth.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/hvcs/util.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/version/__init__.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/version/declaration.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/version/translator.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/semantic_release/version/version.py +0 -0
- {python-semantic-release-9.1.1 → python-semantic-release-9.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.2.0
|
|
4
4
|
Summary: Automatic Semantic Versioning for Python projects
|
|
5
5
|
Author-email: Rolf Erik Lekang <me@rolflekang.com>
|
|
6
6
|
License: MIT
|
|
@@ -21,6 +21,7 @@ Description-Content-Type: text/x-rst
|
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
License-File: AUTHORS.rst
|
|
23
23
|
Requires-Dist: click<9,>=8
|
|
24
|
+
Requires-Dist: click-option-group~=0.5
|
|
24
25
|
Requires-Dist: gitpython<4,>=3.0.8
|
|
25
26
|
Requires-Dist: requests<3,>=2.25
|
|
26
27
|
Requires-Dist: jinja2<4,>=3.1.2
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = sphinx-build
|
|
7
|
+
PAPER =
|
|
8
|
+
BUILDDIR = _build
|
|
9
|
+
|
|
10
|
+
# User-friendly check for sphinx-build
|
|
11
|
+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
|
12
|
+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
|
13
|
+
endif
|
|
14
|
+
|
|
15
|
+
# Internal variables.
|
|
16
|
+
PAPEROPT_a4 = -D latex_paper_size=a4
|
|
17
|
+
PAPEROPT_letter = -D latex_paper_size=letter
|
|
18
|
+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
|
19
|
+
# the i18n builder cannot share the environment and doctrees with the others
|
|
20
|
+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
|
21
|
+
|
|
22
|
+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
|
23
|
+
|
|
24
|
+
help:
|
|
25
|
+
@echo "Please use \`make <target>' where <target> is one of"
|
|
26
|
+
@echo " html to make standalone HTML files"
|
|
27
|
+
@echo " dirhtml to make HTML files named index.html in directories"
|
|
28
|
+
@echo " singlehtml to make a single large HTML file"
|
|
29
|
+
@echo " pickle to make pickle files"
|
|
30
|
+
@echo " json to make JSON files"
|
|
31
|
+
@echo " htmlhelp to make HTML files and a HTML help project"
|
|
32
|
+
@echo " qthelp to make HTML files and a qthelp project"
|
|
33
|
+
@echo " devhelp to make HTML files and a Devhelp project"
|
|
34
|
+
@echo " epub to make an epub"
|
|
35
|
+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
|
36
|
+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
|
37
|
+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
|
38
|
+
@echo " text to make text files"
|
|
39
|
+
@echo " man to make manual pages"
|
|
40
|
+
@echo " texinfo to make Texinfo files"
|
|
41
|
+
@echo " info to make Texinfo files and run them through makeinfo"
|
|
42
|
+
@echo " gettext to make PO message catalogs"
|
|
43
|
+
@echo " changes to make an overview of all changed/added/deprecated items"
|
|
44
|
+
@echo " xml to make Docutils-native XML files"
|
|
45
|
+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
|
46
|
+
@echo " linkcheck to check all external links for integrity"
|
|
47
|
+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
|
48
|
+
|
|
49
|
+
clean:
|
|
50
|
+
rm -rf $(BUILDDIR)/*
|
|
51
|
+
|
|
52
|
+
html:
|
|
53
|
+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
|
54
|
+
@echo
|
|
55
|
+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
56
|
+
|
|
57
|
+
dirhtml:
|
|
58
|
+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
|
59
|
+
@echo
|
|
60
|
+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
61
|
+
|
|
62
|
+
singlehtml:
|
|
63
|
+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
|
64
|
+
@echo
|
|
65
|
+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
66
|
+
|
|
67
|
+
pickle:
|
|
68
|
+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
|
69
|
+
@echo
|
|
70
|
+
@echo "Build finished; now you can process the pickle files."
|
|
71
|
+
|
|
72
|
+
json:
|
|
73
|
+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
|
74
|
+
@echo
|
|
75
|
+
@echo "Build finished; now you can process the JSON files."
|
|
76
|
+
|
|
77
|
+
htmlhelp:
|
|
78
|
+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
|
79
|
+
@echo
|
|
80
|
+
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
|
81
|
+
".hhp project file in $(BUILDDIR)/htmlhelp."
|
|
82
|
+
|
|
83
|
+
qthelp:
|
|
84
|
+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
|
85
|
+
@echo
|
|
86
|
+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
|
87
|
+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
|
88
|
+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python-semantic-release.qhcp"
|
|
89
|
+
@echo "To view the help file:"
|
|
90
|
+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python-semantic-release.qhc"
|
|
91
|
+
|
|
92
|
+
devhelp:
|
|
93
|
+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
|
94
|
+
@echo
|
|
95
|
+
@echo "Build finished."
|
|
96
|
+
@echo "To view the help file:"
|
|
97
|
+
@echo "# mkdir -p $$HOME/.local/share/devhelp/python-semantic-release"
|
|
98
|
+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python-semantic-release"
|
|
99
|
+
@echo "# devhelp"
|
|
100
|
+
|
|
101
|
+
epub:
|
|
102
|
+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
|
103
|
+
@echo
|
|
104
|
+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
|
105
|
+
|
|
106
|
+
latex:
|
|
107
|
+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
108
|
+
@echo
|
|
109
|
+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
|
110
|
+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
|
111
|
+
"(use \`make latexpdf' here to do that automatically)."
|
|
112
|
+
|
|
113
|
+
latexpdf:
|
|
114
|
+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
115
|
+
@echo "Running LaTeX files through pdflatex..."
|
|
116
|
+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
|
117
|
+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
118
|
+
|
|
119
|
+
latexpdfja:
|
|
120
|
+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
121
|
+
@echo "Running LaTeX files through platex and dvipdfmx..."
|
|
122
|
+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
|
123
|
+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
124
|
+
|
|
125
|
+
text:
|
|
126
|
+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
|
127
|
+
@echo
|
|
128
|
+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
|
129
|
+
|
|
130
|
+
man:
|
|
131
|
+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
|
132
|
+
@echo
|
|
133
|
+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
|
134
|
+
|
|
135
|
+
texinfo:
|
|
136
|
+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
|
137
|
+
@echo
|
|
138
|
+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
|
139
|
+
@echo "Run \`make' in that directory to run these through makeinfo" \
|
|
140
|
+
"(use \`make info' here to do that automatically)."
|
|
141
|
+
|
|
142
|
+
info:
|
|
143
|
+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
|
144
|
+
@echo "Running Texinfo files through makeinfo..."
|
|
145
|
+
make -C $(BUILDDIR)/texinfo info
|
|
146
|
+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
|
147
|
+
|
|
148
|
+
gettext:
|
|
149
|
+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
|
150
|
+
@echo
|
|
151
|
+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
|
152
|
+
|
|
153
|
+
changes:
|
|
154
|
+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
|
155
|
+
@echo
|
|
156
|
+
@echo "The overview file is in $(BUILDDIR)/changes."
|
|
157
|
+
|
|
158
|
+
linkcheck:
|
|
159
|
+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
|
160
|
+
@echo
|
|
161
|
+
@echo "Link check complete; look for any errors in the above output " \
|
|
162
|
+
"or in $(BUILDDIR)/linkcheck/output.txt."
|
|
163
|
+
|
|
164
|
+
doctest:
|
|
165
|
+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
|
166
|
+
@echo "Testing of doctests in the sources finished, look at the " \
|
|
167
|
+
"results in $(BUILDDIR)/doctest/output.txt."
|
|
168
|
+
|
|
169
|
+
xml:
|
|
170
|
+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
|
171
|
+
@echo
|
|
172
|
+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
|
173
|
+
|
|
174
|
+
pseudoxml:
|
|
175
|
+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
|
176
|
+
@echo
|
|
177
|
+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
|
178
|
+
|
|
179
|
+
coverage:
|
|
180
|
+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
|
181
|
+
|
|
182
|
+
livehtml:
|
|
183
|
+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
.. _algorithm:
|
|
2
|
+
|
|
3
|
+
Python Semantic Release's Version Bumping Algorithm
|
|
4
|
+
===================================================
|
|
5
|
+
|
|
6
|
+
Below is a technical description of the algorithm which Python Semantic Release
|
|
7
|
+
uses to calculate a new version for a project.
|
|
8
|
+
|
|
9
|
+
.. _algorithm-assumptions:
|
|
10
|
+
|
|
11
|
+
Assumptions
|
|
12
|
+
~~~~~~~~~~~
|
|
13
|
+
|
|
14
|
+
* At runtime, we are in a Git repository with HEAD referring to a commit on
|
|
15
|
+
some branch of the repository (i.e. not in detached HEAD state).
|
|
16
|
+
* We know in advance whether we want to produce a prerelease or not (based on
|
|
17
|
+
the configuration and command-line flags).
|
|
18
|
+
* We can parse the tags of the repository into semantic versions, as we are given
|
|
19
|
+
the format that those Git tags should follow via configuration, but cannot
|
|
20
|
+
cherry-pick only tags that apply to commits on specific branches. We must parse
|
|
21
|
+
all tags in order to ensure we have parsed any that might apply to commits in
|
|
22
|
+
this branch's history.
|
|
23
|
+
* If we can identify a commit as a ``merge-base`` between our HEAD commit and one
|
|
24
|
+
or more tags, then that merge-base should be unique.
|
|
25
|
+
* We know ahead of time what ``prerelease_token`` to use for prereleases - e.g.
|
|
26
|
+
``rc``.
|
|
27
|
+
* We know ahead of time whether ``major`` changes introduced by commits
|
|
28
|
+
should cause the new version to remain on ``0.y.z`` if the project is already
|
|
29
|
+
on a ``0.`` version - see :ref:`major_on_zero <config-major-on-zero>`.
|
|
30
|
+
|
|
31
|
+
.. _algorithm-implementation:
|
|
32
|
+
|
|
33
|
+
Implementation
|
|
34
|
+
~~~~~~~~~~~~~~
|
|
35
|
+
|
|
36
|
+
1. Parse all the Git tags of the repository into semantic versions, and **sort**
|
|
37
|
+
in descending (most recent first) order according to `semver precedence`_.
|
|
38
|
+
Ignore any tags which do not correspond to valid semantic vesrions according
|
|
39
|
+
to ``tag_format``.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
2. Find the ``merge-base`` of HEAD and the latest tag according to the sort above.
|
|
43
|
+
Call this commit ``M``.
|
|
44
|
+
If there are no tags in the repo's history, we set ``M=HEAD``.
|
|
45
|
+
|
|
46
|
+
3. Find the latest non-prerelease version whose tag references a commit that is
|
|
47
|
+
an ancestor of ``M``. We do this via a breadth-first search through the commit
|
|
48
|
+
lineage, starting against ``M``, and for each tag checking if the tag
|
|
49
|
+
corresponds to that commit. We break from the search when we find such a tag.
|
|
50
|
+
If no such tag is found, see 4a).
|
|
51
|
+
Else, suppose that tag corresponds to a commit ``L`` - goto 4b).
|
|
52
|
+
|
|
53
|
+
4.
|
|
54
|
+
a. If no commit corresponding to the last non-prerelease version is found,
|
|
55
|
+
the entire history of the repository is considered. We parse every commit
|
|
56
|
+
that is an ancestor of HEAD to determine the type of change introduced -
|
|
57
|
+
either ``major``, ``minor``, ``patch``, ``prerelease_revision`` or
|
|
58
|
+
``no_release``. We store this levels in a ``set`` as we only require
|
|
59
|
+
the distinct types of change that were introduced.
|
|
60
|
+
b. However, if we found a commit ``L`` which is the commit against which the
|
|
61
|
+
last non-prerelease was tagged, then we parse only the commits from HEAD
|
|
62
|
+
as far back as ``L``, to understand what changes have been introduced
|
|
63
|
+
since the previous non-prerelease. We store these levels - either
|
|
64
|
+
``major``, ``minor``, ``patch``, ``prerelease_revision``, or
|
|
65
|
+
``no_release``, in a set, as we only require the distinct types of change
|
|
66
|
+
that were introduced.
|
|
67
|
+
|
|
68
|
+
c. We look for tags that correspond to each commit during this process, to
|
|
69
|
+
identify the latest pre-release that was made within HEAD's ancestry.
|
|
70
|
+
|
|
71
|
+
5. If there have been no changes since the last non-prerelease, or all commits
|
|
72
|
+
since that release result in a ``no_release`` type according to the commit
|
|
73
|
+
parser, then we **terminate the algorithm.**
|
|
74
|
+
|
|
75
|
+
6. If we have not exited by this point, we know the following information:
|
|
76
|
+
|
|
77
|
+
* The latest version, by `semver precedence`_, within the whole repository.
|
|
78
|
+
Call this ``LV``. This might not be within the ancestry of HEAD.
|
|
79
|
+
* The latest version, prerelease or non-prerelease, within the whole repository.
|
|
80
|
+
Call this ``LVH``. This might not be within the ancestry of HEAD.
|
|
81
|
+
This may be the same as ``LV``.
|
|
82
|
+
* The latest non-prerelease version within the ancestry of HEAD. Call this
|
|
83
|
+
``LVHF``. This may be the same as ``LVH``.
|
|
84
|
+
* The most significant type of change introduced by the commits since the
|
|
85
|
+
previous full release. Call this ``level``
|
|
86
|
+
* Whether or not we wish to produce a prerelease from this version increment.
|
|
87
|
+
Call this a boolean flag, ``prerelease``. (Assumption)
|
|
88
|
+
* Whether or not to increment the major digit if a major change is introduced
|
|
89
|
+
against an existing ``0.`` version. Call this ``major_on_zero``, a boolean
|
|
90
|
+
flag. (Assumption)
|
|
91
|
+
|
|
92
|
+
Using this information, the new version is decided according to the following
|
|
93
|
+
criteria:
|
|
94
|
+
|
|
95
|
+
a. If ``LV`` has a major digit of ``0``, ``major_on_zero`` is ``False`` and
|
|
96
|
+
``level`` is ``major``, reduce ``level`` to ``minor``.
|
|
97
|
+
|
|
98
|
+
b. If ``prerelease=True``, then
|
|
99
|
+
|
|
100
|
+
i. Diff ``LV`` with ``LVHF``, to understand if the ``major``, ``minor`` or
|
|
101
|
+
``patch`` digits have changed. For example, diffing ``1.2.1`` and
|
|
102
|
+
``1.2.0`` is a ``patch`` diff, while diffing ``2.1.1`` and ``1.17.2`` is
|
|
103
|
+
a ``major`` diff. Call this ``DIFF``
|
|
104
|
+
|
|
105
|
+
ii. If ``DIFF`` is less semantically significant than ``level``, for example
|
|
106
|
+
if ``DIFF=patch`` and ``level=minor``, then
|
|
107
|
+
|
|
108
|
+
1. Increment the digit of ``LVF`` corresponding to ``level``, for example
|
|
109
|
+
the minor digit if ``level=minor``, setting all less significant
|
|
110
|
+
digits to zero.
|
|
111
|
+
|
|
112
|
+
2. Add ``prerelease_token`` as a suffix result of 1., together with a
|
|
113
|
+
prerelease revision number of ``1``. Return this new version and
|
|
114
|
+
**terminate the algorithm.**
|
|
115
|
+
|
|
116
|
+
Thus if ``DIFF=patch``, ``level=minor``, ``prerelease=True``,
|
|
117
|
+
``prerelease_token="rc"``, and ``LVF=1.1.1``,
|
|
118
|
+
then the version returned by the algorithm is ``1.2.0-rc.1``.
|
|
119
|
+
|
|
120
|
+
iii. If ``DIFF`` is semantically less significant than or equally
|
|
121
|
+
significant to ``level``, then this means that the significance
|
|
122
|
+
of change introduced by ``level`` is already reflected in a
|
|
123
|
+
prerelease version that has been created since the last full release.
|
|
124
|
+
For example, if ``LVHF=1.1.1``, ``LV=1.2.0-rc.1`` and ``level=minor``.
|
|
125
|
+
|
|
126
|
+
In this case we:
|
|
127
|
+
|
|
128
|
+
1. If the prerelease token of ``LV`` is different from
|
|
129
|
+
``prerelease_token``, take the major, minor and patch digits
|
|
130
|
+
of ``LV`` and construct a prerelease version using our given
|
|
131
|
+
``prerelease_token`` and a prerelease revision of ``1``. We
|
|
132
|
+
then return this version and **terminate the algorithm.**
|
|
133
|
+
|
|
134
|
+
For example, if ``LV=1.2.0-rc.1`` and ``prerelease_token=alpha``,
|
|
135
|
+
we return ``1.2.0-alpha.1``.
|
|
136
|
+
|
|
137
|
+
2. If the prerelease token of ``LV`` is the same as ``prerelease_token``,
|
|
138
|
+
we increment the revision number of ``LV``, return this version, and
|
|
139
|
+
|
|
140
|
+
**terminate the algorithm.**
|
|
141
|
+
For example, if ``LV=1.2.0-rc.1`` and ``prerelease_token=rc``,
|
|
142
|
+
we return ``1.2.0-rc.2``.
|
|
143
|
+
|
|
144
|
+
c. If ``prerelease=False``, then
|
|
145
|
+
|
|
146
|
+
i. If ``LV`` is not a prerelease, then we increment the digit of ``LV``
|
|
147
|
+
corresponding to ``level``, for example the minor digit if ``level=minor``,
|
|
148
|
+
setting all less significant digits to zero.
|
|
149
|
+
We return the result of this and **terminate the algorithm**.
|
|
150
|
+
|
|
151
|
+
ii. If ``LV`` is a prerelease, then:
|
|
152
|
+
|
|
153
|
+
1. Diff ``LV`` with ``LVHF``, to understand if the ``major``, ``minor`` or
|
|
154
|
+
``patch`` digits have changed. Call this ``DIFF``
|
|
155
|
+
|
|
156
|
+
2. If ``DIFF`` is less semantically significant than ``level``, then
|
|
157
|
+
|
|
158
|
+
i. Increment the digit of ``LV`` corresponding to ``level``, for example
|
|
159
|
+
the minor digit if ``level=minor``, setting all less significant
|
|
160
|
+
digits to zero.
|
|
161
|
+
|
|
162
|
+
ii. Remove the prerelease token and revision number from the result of i.,
|
|
163
|
+
("Finalize" the result of i.) return the result and **terminate the
|
|
164
|
+
algorithm.**
|
|
165
|
+
|
|
166
|
+
For example, if ``LV=1.2.2-alpha.1`` and ``level=minor``, we return
|
|
167
|
+
``1.3.0``.
|
|
168
|
+
|
|
169
|
+
3. If ``DIFF`` is semantically less significant than or equally
|
|
170
|
+
significant to ``level``, then we finalize ``LV``, return the
|
|
171
|
+
result and **terminate the algorithm**.
|
|
172
|
+
|
|
173
|
+
.. _semver precedence: https://semver.org/#spec-item-11
|
|
174
|
+
|
|
175
|
+
.. _algorithm-complexity:
|
|
176
|
+
|
|
177
|
+
Complexity
|
|
178
|
+
~~~~~~~~~~
|
|
179
|
+
|
|
180
|
+
**Space:**
|
|
181
|
+
|
|
182
|
+
A list of parsed tags takes ``O(number of tags)`` in space. Parsing each commit during
|
|
183
|
+
the breadth-first search between ``merge-base`` and the latest tag in the ancestry
|
|
184
|
+
of HEAD takes at worst ``O(number of commits)`` in space to track visited commits.
|
|
185
|
+
Therefore worst-case space complexity will be linear in the number of commits in the
|
|
186
|
+
repo, unless the number of tags significantly exceeds the number of commits
|
|
187
|
+
(in which case it will be linear in the number of tags).
|
|
188
|
+
|
|
189
|
+
**Time:**
|
|
190
|
+
|
|
191
|
+
Assuming using regular expression parsing of each tag is a constant-time operation,
|
|
192
|
+
then the following steps contribute to the time complexity of the algorithm:
|
|
193
|
+
|
|
194
|
+
* Parsing each tag - ``O(number of tags)``
|
|
195
|
+
* Sorting tags by `semver precedence`_ -
|
|
196
|
+
``O(number of tags * log(number of tags))``
|
|
197
|
+
* Finding the merge-base of HEAD and the latest release tag -
|
|
198
|
+
``O(number of commits)`` (worst case)
|
|
199
|
+
* Parsing each commit and checking each tag against each commit -
|
|
200
|
+
``O(number of commits) + O(number of tags * number of commits)``
|
|
201
|
+
(worst case)
|
|
202
|
+
|
|
203
|
+
Overall, assuming that the number of tags is less than or equal to the number
|
|
204
|
+
of commits in the repository, this would lead to a worst-case time complexity
|
|
205
|
+
that's quadratic in the number of commits in the repo.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.. _cronjobs:
|
|
2
|
+
|
|
3
|
+
Publish with cronjobs
|
|
4
|
+
~~~~~~~~~~~~~~~~~~~~~
|
|
5
|
+
|
|
6
|
+
This is for you if for some reason you cannot publish from your CI or you would like releases to
|
|
7
|
+
drop at a certain interval. Before you start, answer this: Are you sure you do not want a CI to
|
|
8
|
+
release for you? (high version numbers are not a bad thing).
|
|
9
|
+
|
|
10
|
+
The guide below is for setting up scheduled publishing on a server. It requires that the user
|
|
11
|
+
that runs the cronjob has push access to the repository and upload access to an artifact repository.
|
|
12
|
+
|
|
13
|
+
1. Create a virtualenv::
|
|
14
|
+
|
|
15
|
+
virtualenv semantic_release -p `which python3`
|
|
16
|
+
|
|
17
|
+
2. Install python-semantic-release::
|
|
18
|
+
|
|
19
|
+
pip install python-semantic-release
|
|
20
|
+
|
|
21
|
+
3. Clone the repositories you want to have scheduled publishing.
|
|
22
|
+
3. Put the following in ``publish``::
|
|
23
|
+
|
|
24
|
+
VENV=semantic_release/bin
|
|
25
|
+
|
|
26
|
+
$VENV/pip install -U pip python-semantic-release > /dev/null
|
|
27
|
+
|
|
28
|
+
publish() {
|
|
29
|
+
cd $1
|
|
30
|
+
git stash -u # ensures that there is no untracked files in the directory
|
|
31
|
+
git fetch && git reset --hard origin/master
|
|
32
|
+
$VENV/semantic-release version && $VENV/semantic-release publish
|
|
33
|
+
cd ..
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
publish <package1>
|
|
37
|
+
publish <package2>
|
|
38
|
+
|
|
39
|
+
4. Add cronjob::
|
|
40
|
+
|
|
41
|
+
/bin/bash -c "cd <path> && source semantic_release/bin/activate && ./publish 2>&1 >> releases.log"
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.. _github-actions:
|
|
2
|
+
|
|
3
|
+
Setting up python-semantic-release on GitHub Actions
|
|
4
|
+
====================================================
|
|
5
|
+
|
|
6
|
+
Python Semantic Release includes a GitHub Action which runs the ``version`` and
|
|
7
|
+
``publish`` commands. The repository is set to ``PyPI``. You can read the full set
|
|
8
|
+
of inputs available, and their descriptions in the `action definition`_.
|
|
9
|
+
|
|
10
|
+
Your project's configuration file will be used as normal.
|
|
11
|
+
|
|
12
|
+
The GitHub Action provides the following outputs:
|
|
13
|
+
|
|
14
|
+
+-------------+-----------------------------------------------------------+
|
|
15
|
+
| Output | Description |
|
|
16
|
+
+-------------+-----------------------------------------------------------+
|
|
17
|
+
| released | "true" if a release was made, "false" otherwise |
|
|
18
|
+
+-------------+-----------------------------------------------------------+
|
|
19
|
+
| version | The newly released version if one was made, otherwise |
|
|
20
|
+
| | the current version |
|
|
21
|
+
+-------------+-----------------------------------------------------------+
|
|
22
|
+
| tag | The Git tag corresponding to the "version" output. The |
|
|
23
|
+
| | format is dictated by your configuration. |
|
|
24
|
+
+-------------+-----------------------------------------------------------+
|
|
25
|
+
|
|
26
|
+
.. _action definition: https://github.com/python-semantic-release/python-semantic-release/blob/master/action.yml
|
|
27
|
+
|
|
28
|
+
Example Workflow
|
|
29
|
+
----------------
|
|
30
|
+
|
|
31
|
+
.. code:: yaml
|
|
32
|
+
|
|
33
|
+
name: Semantic Release
|
|
34
|
+
|
|
35
|
+
on:
|
|
36
|
+
push:
|
|
37
|
+
branches:
|
|
38
|
+
- master
|
|
39
|
+
|
|
40
|
+
jobs:
|
|
41
|
+
release:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
concurrency: release
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write
|
|
46
|
+
contents: write
|
|
47
|
+
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v3
|
|
50
|
+
with:
|
|
51
|
+
fetch-depth: 0
|
|
52
|
+
|
|
53
|
+
- name: Python Semantic Release
|
|
54
|
+
uses: python-semantic-release/python-semantic-release@master
|
|
55
|
+
with:
|
|
56
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
57
|
+
|
|
58
|
+
``concurrency`` is a
|
|
59
|
+
`beta feature of GitHub Actions <https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency>`_
|
|
60
|
+
which disallows two or more release jobs to run in parallel. This prevents race
|
|
61
|
+
conditions if there are multiple pushes in a short period of time.
|
|
62
|
+
|
|
63
|
+
If you would like to use Python Semantic Release to create GitHub Releases against
|
|
64
|
+
your repository, you will need to allow the additional ``contents: write`` permission.
|
|
65
|
+
More information can be found in the `permissions for GitHub Apps documentation`_
|
|
66
|
+
|
|
67
|
+
.. _permissions for GitHub Apps documentation: https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#contents
|
|
68
|
+
|
|
69
|
+
.. warning::
|
|
70
|
+
You must set ``fetch-depth`` to 0 when using ``actions/checkout@v2``, since
|
|
71
|
+
Python Semantic Release needs access to the full history to determine whether
|
|
72
|
+
a release should be made.
|
|
73
|
+
|
|
74
|
+
.. warning::
|
|
75
|
+
The ``GITHUB_TOKEN`` secret is automatically configured by GitHub, with the
|
|
76
|
+
same permissions as the user who triggered the workflow run. This causes
|
|
77
|
+
a problem if your default branch is protected.
|
|
78
|
+
|
|
79
|
+
You can work around this by storing an administrator's Personal Access Token
|
|
80
|
+
as a separate secret and using that instead of ``GITHUB_TOKEN``. In this
|
|
81
|
+
case, you will also need to pass the new token to ``actions/checkout`` (as
|
|
82
|
+
the ``token`` input) in order to gain push access.
|
|
83
|
+
|
|
84
|
+
Multiple Projects
|
|
85
|
+
-----------------
|
|
86
|
+
|
|
87
|
+
If you have multiple projects stored within a single repository (or your
|
|
88
|
+
project is not at the root of the repository), you can pass the
|
|
89
|
+
``directory`` input. The step can be called multiple times to release
|
|
90
|
+
multiple projects.
|
|
91
|
+
|
|
92
|
+
.. code:: yaml
|
|
93
|
+
|
|
94
|
+
- name: Release Project 1
|
|
95
|
+
uses: python-semantic-release/python-semantic-release@master
|
|
96
|
+
with:
|
|
97
|
+
directory: ./project1
|
|
98
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
99
|
+
|
|
100
|
+
- name: Release Project 2
|
|
101
|
+
uses: python-semantic-release/python-semantic-release@master
|
|
102
|
+
with:
|
|
103
|
+
directory: ./project2
|
|
104
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.. _automatic:
|
|
2
|
+
|
|
3
|
+
Automatic Releases
|
|
4
|
+
------------------
|
|
5
|
+
|
|
6
|
+
The key point with using this package is to automate your releases and stop worrying about
|
|
7
|
+
version numbers. Different approaches to automatic releases and publishing with the help of
|
|
8
|
+
this package can be found below. Using a CI is the recommended approach.
|
|
9
|
+
|
|
10
|
+
.. _automatic-guides:
|
|
11
|
+
|
|
12
|
+
Guides
|
|
13
|
+
^^^^^^
|
|
14
|
+
|
|
15
|
+
.. toctree::
|
|
16
|
+
travis
|
|
17
|
+
github-actions
|
|
18
|
+
cronjobs
|
|
19
|
+
|
|
20
|
+
.. _automatic-github:
|
|
21
|
+
|
|
22
|
+
Configuring push to Github
|
|
23
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
24
|
+
In order to push to Github and post the changelog to Github the environment variable
|
|
25
|
+
:ref:`GH_TOKEN <index-creating-vcs-releases>` has to be set. It needs access to the
|
|
26
|
+
``public_repo`` scope for public repositories and ``repo`` for private repositories.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Setting up python-semantic-release on Travis CI
|
|
2
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
3
|
+
|
|
4
|
+
This guide expects you to have activated the repository on Travis CI.
|
|
5
|
+
If this is not the case, please refer to `Travis documentation`_ on how to do that.
|
|
6
|
+
|
|
7
|
+
1. Add python-semantic-release settings
|
|
8
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
9
|
+
|
|
10
|
+
See :doc:`../configuration` for details on how to configure Python Semantic Release.
|
|
11
|
+
Make sure that at least you have set :ref:`config-version-variables` before continuing.
|
|
12
|
+
|
|
13
|
+
2. Add environment variables
|
|
14
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
15
|
+
You will need to set up an environment variable in Travis. An easy way to do that
|
|
16
|
+
is to go to the settings page for your package and add it there. Make sure that the
|
|
17
|
+
secret toggle is set correctly.
|
|
18
|
+
|
|
19
|
+
You need to set the :ref:`GH_TOKEN <index-creating-vcs-releases>` environment
|
|
20
|
+
variable with a personal access token for Github. It will need either ``repo`` or
|
|
21
|
+
``public_repo`` scope depending on whether the repository is private or public.
|
|
22
|
+
|
|
23
|
+
More information on how to set environment variables can be found on
|
|
24
|
+
`Travis documentation on environment variables`_.
|
|
25
|
+
|
|
26
|
+
3. Add travis configuration
|
|
27
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
28
|
+
The following should be added to your ``.travis.yml`` file.
|
|
29
|
+
|
|
30
|
+
.. code-block:: yaml
|
|
31
|
+
|
|
32
|
+
after_success:
|
|
33
|
+
- git config --global user.name "semantic-release (via TravisCI)"
|
|
34
|
+
- git config --global user.email "semantic-release@travis"
|
|
35
|
+
- pip install python-semantic-release
|
|
36
|
+
- semantic-release version && semantic-release publish
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
The first line tells Travis that we want to run the listed tasks after a successful build.
|
|
40
|
+
The two first lines in after_success will configure git so that python-semantic-release
|
|
41
|
+
will be able to commit on Travis. The third installs the latest version of python-semantic-release.
|
|
42
|
+
The last will run the publish command, which will publish a new version if the changes
|
|
43
|
+
indicate that one is due.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
4. Push some changes
|
|
47
|
+
^^^^^^^^^^^^^^^^^^^^
|
|
48
|
+
You are now ready to release automatically on Travis CI on every change to your master branch.
|
|
49
|
+
|
|
50
|
+
Happy coding!
|
|
51
|
+
|
|
52
|
+
.. _Travis documentation: https://docs.travis-ci.com/
|
|
53
|
+
.. _Travis documentation on environment variables: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
|