set_github_release
This will create a new release on GitHub and upload assets for it
Creates a new release on GitHub. You must provide your GitHub Personal token (get one from https://github.com/settings/tokens/new), the repository name and tag name. By default, that's
master
.
If the tag doesn't exist, one will be created on the commit or branch passed in as commitish.
Out parameters provide the release's id, which can be used for later editing and the release HTML link to GitHub. You can also specify a list of assets to be uploaded to the release with the:upload_assets
parameter.
set_github_release | |
---|---|
Supported platforms | mac, linux, windows |
Author | @czechboy0, @tommeier |
Returns | A hash containing all relevant information of this release Access things like 'html_url', 'tag_name', 'name', 'body' |
1 Example
github_release = set_github_release( repository_name: "urbanquakers/pantograph", api_token: ENV["GITHUB_TOKEN"], name: "Super New actions", tag_name: "v1.22.0", description: (File.read("changelog") rescue "No changelog provided"), commitish: "master", upload_assets: ["example_integration.ipa", "./pkg/built.gem"] )
Parameters
Key | Description | Default |
---|---|---|
repository_name |
The path to your repo, e.g. 'urbanquakers/pantograph' | |
server_url |
The server url. e.g. 'https://your.internal.github.host/api/v3' (Default: 'https://api.github.com') | https://api.github.com |
api_token |
Personal API Token for GitHub - generate one at https://github.com/settings/tokens | * |
tag_name |
Pass in the tag name | |
name |
Name of this release | |
commitish |
Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master) | |
description |
Description of this release | * |
is_draft |
Whether the release should be marked as draft | false |
is_prerelease |
Whether the release should be marked as prerelease | false |
upload_assets |
Path to assets to be uploaded with the release |
* = default value is dependent on the user's system
Lane Variables
Actions can communicate with each other using a shared hash lane_context
, that can be accessed in other actions, plugins or your lanes: lane_context[SharedValues:XYZ]
. The set_github_release
action generates the following Lane Variables:
SharedValue | Description |
---|---|
SharedValues::SET_GITHUB_RELEASE_HTML_LINK |
Link to your created release |
SharedValues::SET_GITHUB_RELEASE_RELEASE_ID |
Release id (useful for subsequent editing) |
SharedValues::SET_GITHUB_RELEASE_JSON |
The whole release JSON object |
To get more information check the Lanes documentation.
Documentation
To show the documentation in your terminal, run
pantograph action set_github_release
CLI
It is recommended to add the above action into your Pantfile
, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal
pantograph run set_github_release
To pass parameters, make use of the :
symbol, for example
pantograph run set_github_release parameter1:"value1" parameter2:"value2"
It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. param:"1,2,3"
). Hashes are not currently supported.
It is recommended to add all pantograph actions you use to your Pantfile
.
Source code
This action, just like the rest of pantograph, is fully open source, view the source code on GitHub