Skip to main content

Utility for use in gitlab ci to upload files (from build) to the current projects release (tag)

Project description

This python script uses the gitlab api to simplify uploading specific files from a gitlab-ci build as downloadable resources for a tagged release.

It can be used in a gitlab-ci.yml stage like:

release:
  stage: release
  script:
    - pip3 install gitlab_release
    - python3 -m gitlab_release $PRIVATE_TOKEN *.zip
  only:
    - tags

Or if you want to bundle a bunch of files into a zip and upload that

release:
  stage: release
  script:
    - pip3 install gitlab_release
    - python3 -m gitlab_release --zip "release-${CI_COMMIT_TAG}.zip" " $PRIVATE_TOKEN *
  only:
    - tags

This currently requires you to put a copy of your PRIVATE_TOKEN in a secret CI variable for it to post back to the project

Get token from https://gitlab.com/profile/account

Or better, create a Personal Access Token and use that: https://gitlab.com/profile/personal_access_tokens

Add it to a secret variable called PRIVATE_TOKEN for the project you’re building at https://gitlab.com/<user>/<project>/settings/ci_cd

On any tagged release the files specified in the glob will then be availble on the Tags tab of your project

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

gitlab_release-1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file gitlab_release-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gitlab_release-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2b37053aa75fdf99d4b580b31986fe52d455efd5a03aab0cd0dbba7b5346115
MD5 23b33c6f0afbfdb8be04d709654a6c38
BLAKE2b-256 c6845baa86d1c906a7b4b08af0352017a402927f2d4a011e2994c5e5e5ee40bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page