Upload distributions to GitLab
Hi,
Is there a way to upload the dist folder to gitlab. Going thourgh the code ,it seems that the upload_dists function has't been overridden in the Gitlab class. Are there any alternative ways?
Thanks
When I added the ability to attach distributions to GitHub Releases, I'd never worked with GitLab (and still never have), so I left it out. I'm happy to convert this issue into a feature request to get something similar added if you'd like.
Sure, that would be great.
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.
@e0lithic You can push to Gitlab instead of PyPi, see documentation at https://python-semantic-release.readthedocs.io/en/latest/#distributing-release-on-pypi-or-custom-repository
Point custom_url to ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi, set REPOSITORY_USERNAME to gitlab-ci-token and REPOSITORY_PASSWORD to $CI_JOB_TOKEN
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.
Hello,
When I launch semantic-release publish I also this message
semantic_release/hvcs/_base.py:88: UserWarning: upload_dists is not supported by Gitlab
_not_supported(self, "upload_dists")
The content of upload_dists in gitlab.py is not implemented, there are work in progress ?
Thanks
@general03, not that I am aware of. I would also validate this is actually what you desire. Part of the reason this has not been implemented is because GitLab makes the approach of release assets differently.
It is important to distinguish that if you are desiring to publish to the GitLab Package Registry for pip integration. The upload_dists() function does not provide this functionality. This is a common misconception.
I need to publish a Gitlab release like this
When I used the version 7, all worked fine but since I updated to version 9 I can't do this
Ok good, yes, the assets section would be the proper output of the upload_dists function.
And It is not compatible with gitlab ?
And It is not compatible with gitlab ?
Don't know yet, I've only been on the periphery of GitLab support of Releases. I was doing a lot of GitLab when it wasn't possible and then it updated fairly quickly over the past 4 years. Just from the Release GUI, i remember it just wasn't the same as GitHub in how you upload files.
@general03, looked at GitLab docs, GitLab does not support assets in the same manner as GitHub where the asset storage is a separate storage area from the "registries". It uses the Generic Package Registry as the backing file storage and then asset links can be attached to the release notes.
If this was going to be implemented (like GitHub), then PSR would publish the files to the Generic Package Registry via the API and then create an asset link in the release notes.
My hesitation with this is that if the project is Python distribution artifacts (sdist, wheel), the expectation would be to publish it to the GitLab Python Package Registry so that pip could download these and the asset links would point to the GitLab Python Package Registry entries. The problem is that with the migration to v8, PSR removed the internal wrapping of the twine tool to publish to Python Registries (it's now the users responsibility to run the twine command). With that in mind how would you imagine providing the input to the publish command to tell PSR where the assets are located (link location)?
Essentially you could even point these links to the Pypi registry.
hum I'm something that I don't understand because now I can create "Gitlab Release" with command semantic-release version, normal ?
So what do the command semantic-release publish ?
Thanks
hum I'm something that I don't understand because now I can create "Gitlab Release" with command
semantic-release version, normal ?So what do the command
semantic-release publish?
Please take a look at my responses here as this has been asked before: https://github.com/python-semantic-release/python-semantic-release/issues/802#issuecomment-1899692167
But also please provide a recommendation on how you would like to see upload_dists via links implemented