python-semantic-release icon indicating copy to clipboard operation
python-semantic-release copied to clipboard

Upload distributions to GitLab

Open e0lithic opened this issue 5 years ago • 12 comments

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

e0lithic avatar May 03 '20 19:05 e0lithic

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.

danth avatar May 03 '20 19:05 danth

Sure, that would be great.

e0lithic avatar May 03 '20 19:05 e0lithic

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.

github-actions[bot] avatar May 25 '20 00:05 github-actions[bot]

@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

fleXible avatar Dec 04 '21 10:12 fleXible

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.

github-actions[bot] avatar Dec 26 '21 01:12 github-actions[bot]

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 avatar Feb 16 '24 15:02 general03

@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.

codejedi365 avatar Feb 17 '24 02:02 codejedi365

I need to publish a Gitlab release like this image When I used the version 7, all worked fine but since I updated to version 9 I can't do this

general03 avatar Feb 17 '24 18:02 general03

Ok good, yes, the assets section would be the proper output of the upload_dists function.

codejedi365 avatar Feb 17 '24 18:02 codejedi365

And It is not compatible with gitlab ?

general03 avatar Feb 17 '24 19:02 general03

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.

codejedi365 avatar Feb 17 '24 20:02 codejedi365

@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.

codejedi365 avatar Feb 17 '24 23:02 codejedi365

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

general03 avatar Mar 06 '24 13:03 general03

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

codejedi365 avatar Mar 06 '24 13:03 codejedi365