Skip to content

Commit

Permalink
ci: handle semantic version releases with tags only
Browse files Browse the repository at this point in the history
  • Loading branch information
anayeaye committed Sep 12, 2023
1 parent e783a5a commit 163a89c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,6 @@ jobs:
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
changelog: "false"
vcs-release: "true"
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,7 @@ jobs:
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
changelog: "false"
vcs-release: "true"
github_token: ${{ secrets.GITHUB_TOKEN }}

4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ This project currently implements python-semantic-release defaults in [pyproject

### Automated releases

Release branch groups are configured in [pyproject.toml](pyproject.toml). Merges in to the develop branch generate pre release candidates. When the develop branch is merged into main, new releases are generated by dropping the `rc.<increment>` from the release candidate version. Release changelogs are generated from conventional commit messages.
Release branch groups are configured in [pyproject.toml](pyproject.toml). Merges in to the develop branch generate pre release candidates. When the develop branch is merged into main, new releases are generated by dropping the `rc.<increment>` from the release candidate version. Release changes are generated from conventional commit messages.

> **Note:** Release versions are managed with git tags only to avoid managing an admin token for the release action.
## Tips and tools

Expand Down
25 changes: 1 addition & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.semantic_release]
version_variables = ["setup.py:__version__"]
version_source = "tag_only"
assets = []
commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
commit_parser = "angular"
Expand All @@ -17,29 +17,6 @@ match = "develop"
prerelease = true
prerelease_token = "rc"

[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = []

[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
comment_start_string = "{#"
comment_end_string = "#}"
trim_blocks = false
lstrip_blocks = false
newline_sequence = "\n"
keep_trailing_newline = false
extensions = []
autoescape = true

[tool.semantic_release.commit_author]
env = "GIT_COMMIT_AUTHOR"
default = "semantic-release <semantic-release>"

[tool.semantic_release.commit_parser_options]
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
minor_tags = ["feat"]
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
with open("README.md") as f:
long_description = f.read()

# This version is managed by python-semantic-release using github release tags; manual changes will be overwritten
__version__ = "0.0.0"

extra_reqs = {
"dev": ["pre-commit", "python-dotenv"],
"deploy": [
Expand All @@ -29,7 +26,6 @@

setup(
name="veda-backend",
version=__version__,
description="",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 163a89c

Please sign in to comment.