2016-08-26 08:38:22 +00:00
Use this plugin for publishing files and artifacts to GitHub releases. Be aware
that you can use this plugin only for tags, GitHub doesn't support the release
of branches.
2015-11-23 00:07:57 +00:00
2016-08-26 08:38:22 +00:00
## Config
2015-11-23 00:07:57 +00:00
2016-08-26 08:38:22 +00:00
The following parameters are used to configure the plugin:
* **api_key** - GitHub oauth token with public_repo or repo permission
* **files** - files to upload to GitHub Release, globs are allowed
* **file_exists** - what to do if an file asset already exists, supported values: **overwrite** (default), **skip** and **fail**
* **checksum** - checksum takes hash methods to include in your GitHub release for the files specified. Supported hash methods include md5, sha1, sha256, sha512, adler32, and crc32.
* **draft** - create a draft release if set to true
2017-03-13 23:07:52 +00:00
* **prerelease** - set the release as prerelease if set to true
2016-08-26 08:38:22 +00:00
* **base_url** - GitHub base URL, only required for GHE
* **upload_url** - GitHub upload URL, only required for GHE
The following secret values can be set to configure the plugin.
* **GITHUB_RELEASE_API_KEY** - corresponds to **api_key**
* **GITHUB_RELEASE_BASE_URL** - corresponds to **base_url**
* **GITHUB_RELEASE_UPLOAD_URL** - corresponds to **upload_url**
It is highly recommended to put the **GITHUB_RELEASE_API_KEY** into a secret so
it is not exposed to users. This can be done using the drone-cli.
```bash
drone secret add --image=plugins/github-release \
octocat/hello-world GITHUB_RELEASE_API_KEY my_github_api_key
```
Then sign the YAML file after all secrets are added.
```bash
drone sign octocat/hello-world
```
See [secrets ](http://readme.drone.io/0.5/usage/secrets/ ) for additional
information on secrets
## Examples
The following is a sample configuration in your .drone.yml file:
2015-11-23 00:07:57 +00:00
```yaml
2016-08-26 08:38:22 +00:00
pipeline:
2015-11-23 00:07:57 +00:00
github_release:
2016-08-26 08:38:22 +00:00
image: plugins/github-release
2016-01-15 22:02:12 +00:00
files: dist/*
2016-08-26 08:38:22 +00:00
when:
event: tag
2016-01-15 21:30:59 +00:00
```
2016-08-26 08:38:22 +00:00
An example for generating checksums and upload additional files:
2016-01-15 21:30:59 +00:00
```yaml
2016-08-26 08:38:22 +00:00
pipeline:
2016-01-15 21:30:59 +00:00
github_release:
2016-08-26 08:38:22 +00:00
image: plugins/github-release
2016-01-15 21:30:59 +00:00
files:
- dist/*
2016-01-15 22:02:12 +00:00
- bin/binary.exe
2016-01-15 21:30:59 +00:00
checksum:
2016-01-15 17:29:12 +00:00
- md5
- sha1
- sha256
- sha512
- adler32
- crc32
2016-08-26 08:38:22 +00:00
when:
event: tag
2015-11-23 00:07:57 +00:00
```