Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ekristen/gitlab-release
Publish Assets to GitLab Release from GitLab CI - This is a MIRROR
https://github.com/ekristen/gitlab-release
git-mirror gitlab gitlab-ci release release-automation
Last synced: 17 days ago
JSON representation
Publish Assets to GitLab Release from GitLab CI - This is a MIRROR
- Host: GitHub
- URL: https://github.com/ekristen/gitlab-release
- Owner: ekristen
- License: mit
- Created: 2019-02-19T22:16:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T12:55:18.000Z (over 4 years ago)
- Last Synced: 2025-01-13T07:47:01.788Z (20 days ago)
- Topics: git-mirror, gitlab, gitlab-ci, release, release-automation
- Language: Shell
- Homepage: https://gitlab.com/ekristen/gitlab-release
- Size: 3.91 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
**IMPORTANT:** If you are viewing this on GitHub, you are viewing a mirror of the [GitLab project](https://gitlab.com/ekristen/gitlab-release).
# GitLab Release
This is a simple bash script designed to run in GitLab CI when tags are pushed to a project to create a release if it does not exist and upload files against the release.
## Overview
The idea is very simple, specify a path where release files are located (via `GR_RELEASE_PATH` env var ) that need to be uploaded against a release. Then define a publish files/binaries job in your `.gitlab-ci.yml` file and sit back and watch your release assets get published automatically when you push a tag.
## Caveats
Unfortunately the `CI_JOB_TOKEN` does not have enough privileges at this time to allow upload of assets or to create a release, so you will need to specify one from an account that has high privileges via the `GR_TOKEN` env var in your GitLab CI/CD Settings for the Project or Group that the project belongs to.
## Usage
This is designed to be run as a docker container with GitLab CI.
### GitLab CI Example Job
```
publish:binaries:
stage: publish
image: ekristen/gitlab-release:latest
dependencies:
- some-previous-job-that-has-artifacts
variables:
GIT_STRATEGY: none
script:
- gitlab-release
only:
refs:
- tags
```### Development
You can mimic the GitLab CI environment by ensuring all the necessary env vars are set. Specifically `GR_TOKEN`, `CI_PROJECT_ID` and `CI_COMMIT_TAG`. If you wish to debug the script, simply set `DEBUG` to any value.