Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
package

GitHub Action

Upload to Release

v0.1.0

Upload to Release

package

Upload to Release

Uploads a file to a new release

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Upload to Release

uses: JasonEtco/[email protected]

Learn more about this action in JasonEtco/upload-to-release

Choose a version

Upload to Release

A GitHub Action that uploads a file to a new release.

Usage

This action uploads any file to a new release:

image

One example workflow is to build and save a Docker image then upload it to a release:

workflow "Package" {
  on = "release"
  resolves = ["Upload to release"]
}

action "Build Docker image" {
  uses = "actions/docker/cli@master"
  args = "build . -t my-image"
}

action "Save the image" {
  uses = "actions/docker/cli@master"
  args = "save my-image:latest"
  needs = ["Build Docker image"]
}

action "Upload to release" {
  uses = "JasonEtco/upload-to-release@master"
  args = "my-image.tar"
  secrets = ["GITHUB_TOKEN"]
  needs = ["Save the image"]
}

Requirements

You must pass at least one argument, the path to the file you want to attach. You must also include the GITHUB_TOKEN secret, otherwise uploading the file will not work.

action "Upload to release" {
  uses = "JasonEtco/upload-to-release@master"
  args = "my-image.tar"
  secrets = ["GITHUB_TOKEN"]
  needs = ["Save the image"]
}

Content-Type

You may also need to pass an additional argument, the Content-Type header used when uploading your file (this is application/zip by default):

action "Upload to release" {
  args = "my-image.tar application/zip"
}