Skip to content

Commit

Permalink
Merge branch 'master' into v1-release
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Aug 23, 2019
2 parents 5a1e8b5 + 95a5876 commit 7fa2bd0
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 69 deletions.
138 changes: 71 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ It runs on all operating systems types offered by GitHub.

You must provide:

- `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`
- `file`: A local file to be uploaded as the asset.
- `asset_name`: The name the file gets as an asset on a release.
- `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.event.ref }}`
- `overwrite`: If an asset with name already exists, overwrite it.
- `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`
- `file`: A local file to be uploaded as the asset.
- `asset_name`: The name the file gets as an asset on a release.
- `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.event.ref }}`
- `overwrite`: If an asset with name already exists, overwrite it.

## Usage

Expand All @@ -20,68 +20,72 @@ This is a common use case as you will want to upload release binaries for your t

Simple example:

name: Publish

on:
create:
tags:

jobs:
build:
name: Publish binaries
runs-on: ubuntu-latest

steps:
- uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/mything
asset_name: mything
tag: {{ github.event.ref }}
overwrite: true
```yaml
name: Publish

on:
create:
tags:

jobs:
build:
name: Publish binaries
runs-on: ubuntu-latest

steps:
- uses: hecrj/setup-rust-action@v1-release
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/mything
asset_name: mything
tag: {{ github.event.ref }}
overwrite: true
```
Complex example with more operating systems:
name: Publish

on:
create:
tags:

jobs:
build:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: mything
asset_name: mything-linux-amd64
- os: windows-latest
artifact_name: mything.exe
asset_name: mything-windows-amd64
- os: macos-latest
artifact_name: mything
asset_name: mything-macos-amd64

steps:
- uses: hecrj/setup-rust-action@master
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
```yaml
name: Publish

on:
create:
tags:

jobs:
build:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: mything
asset_name: mything-linux-amd64
- os: windows-latest
artifact_name: mything.exe
asset_name: mything-windows-amd64
- os: macos-latest
artifact_name: mything
asset_name: mything-macos-amd64

steps:
- uses: hecrj/setup-rust-action@v1-release
with:
rust-version: stable
- uses: actions/checkout@v1
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
```
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
name: 'Upload files to a GitHub release'
description: 'Upload files to a GitHub release (cross-platform)'
author: 'Sven-Hendrik Haase'
branding:
icon: archive
color: orange
inputs:
repo_token:
description: 'GitHub token'
required: true
file:
description: 'Local file to upload'
required: true
asset_name:
description: 'Name of the asset'
required: true
tag:
description: 'Tag to use as a release'
required: true
overwrite:
description: 'Overwrite the release in case it already exists'
runs:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upload-release-action",
"version": "0.0.1",
"version": "1.0.0",
"private": true,
"description": "Upload files to a GitHub release",
"main": "lib/main.js",
Expand Down

0 comments on commit 7fa2bd0

Please sign in to comment.