A GitHub Action that uploads a file to a new release.
Branch: master
Clone or download
JasonEtco Merge pull request #4 from JasonEtco/strip-full-path
Just use the file name, not the full path
Latest commit f6be505 Feb 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Init to winit Dec 4, 2018
Dockerfile Init to winit Dec 4, 2018
LICENSE Init to winit Dec 4, 2018
README.md Add image Dec 4, 2018
upload-to-release Update upload-to-release Feb 16, 2019

README.md

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"
}