Option to disable creation of GitHub releases
The problem
EDIT : I've set upload_to_release to false, but running publish still uploads the changelog and tag to Github releases...
Expected behavior
To not upload to Github releases.
Additional context
pyproject.toml :
[tool.semantic_release]
version_variable = ["modupipe/__init__.py:__version__"]
version_toml = ["pyproject.toml:tool.poetry.version"]
version_source = "tag"
branch = "master"
upload_to_pypi = false
upload_to_release = false
build_command = "poetry build"
commit_version_number = true
commit_subject = "chore(release): v{version}"
commit_message = "Released version {version}. See the changelog for changes."
Hey @vigenere23 ! Checking this is when you run semantic-release publish? Could you post your output from semantic-release publish -v DEBUG if so please?
Yes, when running publish. Also, the changelog is pushed even without the --post flag.
Here's the debug output (the auth token has been hidden)
debug: get_current_version_by_tag()
debug: get_last_version(, pattern='(\d+\.\d+\.\d+(-beta\.\d+)?)')
debug: get_last_version -> 1.0.2
debug: get_current_version_by_tag -> 1.0.2
debug: get_current_release_version_by_tag()
debug: get_last_version(, pattern='v?(\d+\.\d+\.\d+(?!.*-beta\.\d+))')
debug: get_last_version -> 1.0.2
debug: get_current_release_version_by_tag -> 1.0.2
Current version: 1.0.2, Current release version: 1.0.2
debug: evaluate_version_bump('1.0.2', None)
debug: parse_commit_message('feat: to remove')
debug: parse_commit_message -> ParsedCommit(bump=2, type='feature', scope=None, descriptions=['to remove'], breaking_descriptions=[])
debug: Commits found since last release: 1
debug: evaluate_version_bump -> minor
debug: get_new_version('1.0.2', '1.0.2', 'minor', False, True)
debug: get_new_version -> 1.1.0
debug: get_repository_owner_and_name()
debug: get_repository_owner_and_name -> ('vigenere23', 'modupipe')
debug: Running publish on branch master
debug: checkout(master)
debug: checkout -> Your branch is ahead of 'origin/master' by 1 commit.
debug: (use "git push" to publish your local commits)
debug: generate_changelog('1.0.2')
debug: parse_commit_message('feat: to remove')
debug: parse_commit_message -> ParsedCommit(bump=2, type='feature', scope=None, descriptions=['to remove'], breaking_descriptions=[])
debug: Creating new changelog section for feature
debug: generate_changelog -> {'breaking': [], 'feature': [('0ee48a67a3622d3cfc27f3b3bc6cafa261e6d711', 'To remove')]}
debug: markdown_changelog('vigenere23', 'modupipe', '1.1.0', {'breaking': [], 'feature': [('0ee48a67a3622d3cfc27f3b3bc6cafa261e6d711', 'To remove')]}, header=False, previous_version='1.0.2')
debug: markdown_changelog -> ### Feature
debug: * To remove ([`0ee48a6`](https://github.com/vigenere23/modupipe/commit/0ee48a67a3622d3cfc27f3b3bc6cafa261e6d711))
debug: update_changelog_file('1.1.0', '### Feature
debug: * To remove ([`0ee48a6`](https://github.com/vigenere23/modupipe/commit/0ee48a67a3622d3cfc27f3b3bc6cafa261e6d711))')
debug: update_additional_files()
Bumping with a minor version to 1.1.0
debug: set_new_version('1.1.0')
debug: Writing new version number: path=PosixPath('modupipe/__init__.py') pattern='__version__ *[:=] *["\\\'](\\d+\\.\\d+\\.\\d+(-beta\\.\\d+)?)["\\\']' num_matches=1
debug: set_new_version -> True
debug: commit_new_version('1.1.0')
debug: commit_new_version -> [master 5867dd7] chore(release): v1.1.0
debug: Author: semantic-release <semantic-release>
debug: 3 files changed, 6 insertions(+), 2 deletions(-)
debug: tag_new_version('1.1.0')
debug: tag_new_version ->
Pushing new version
debug: get_hvcs()
debug: get_hvcs -> <class 'semantic_release.hvcs.Github'>
debug: get_hvcs()
debug: get_hvcs -> <class 'semantic_release.hvcs.Github'>
debug: push_new_version(, auth_token='***************************', owner='vigenere23', name='modupipe', branch=master, domain='github.com')
debug: get_hvcs()
debug: get_hvcs -> <class 'semantic_release.hvcs.Github'>
Posting changelog to HVCS
debug: Posting release changelog for vigenere23/modupipe 1.1.0
debug: get_hvcs()
debug: get_hvcs -> <class 'semantic_release.hvcs.Github'>
debug: post_release_changelog(<class 'semantic_release.hvcs.Github'>, 'vigenere23', 'modupipe', '1.1.0', '### Feature
debug: * To remove ([`0ee48a6`](https://github.com/vigenere23/modupipe/commit/0ee48a67a3622d3cfc27f3b3bc6cafa261e6d711))')
debug: Attempting to create release for v1.1.0
debug: create_release(<class 'semantic_release.hvcs.Github'>, 'vigenere23', 'modupipe', 'v1.1.0', '### Feature
debug: * To remove ([`0ee48a6`](https://github.com/vigenere23/modupipe/commit/0ee48a67a3622d3cfc27f3b3bc6cafa261e6d711))')
debug: create_release -> True
debug: post_release_changelog -> True
Publish has finished
It's for a single commit called feat: to remove.
OK, I think I've traced this one to here. The changelog should always be pushed to the repo on a release - I think that's expected behaviour.
Posting to GH releases though, it doesn't look like you can currently turn that off - if you've got "GH_TOKEN" set it will post the changelog off to a release. AFAIK the --post flag only changes the behaviour of semantic-release changelog.
The docs for publish do state that this will happen, and the docs for upload_to_release do state that this controls the attachment of distributions to GH releases.
So I think this isn't a bug per-se as it's following the documented behaviour. Having said that, perhaps it's a bit strange to not be able to turn off uploads to releases if you don't want to.
Maybe @danth could re-label this a feature request?
I agree, this is the expected behaviour but we should add a new option for disabling GitHub release creation entirely.
Seems adequate, thanks all for your help and dedication :)
This feature request has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.
It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
As I am re-reading this, I believe this issue is now out-of-date.
There is the --no-vcs-release option for the version command, which disables creation of a release object but still allows a creation of a tag (also available in the GitHub Action).
There is a separate issue (#917) for enabling this option as a configuration entry but is not yet implemented.
With that said, I'm going to close this issue as resolved. If this is in error, we can re-open it but I would need an updated description to resolve.