@@ -7,11 +7,11 @@ It runs on all operating systems types offered by GitHub.
77
88You must provide:
99
10- - `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`
11- - `file`: A local file to be uploaded as the asset.
12- - `asset_name`: The name the file gets as an asset on a release.
13- - `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.event.ref }}`
14- - `overwrite`: If an asset with name already exists, overwrite it.
10+ - ` repo_token ` : Usually you'll want to set this to ` ${{ secrets.GITHUB_TOKEN }} `
11+ - ` file ` : A local file to be uploaded as the asset.
12+ - ` asset_name ` : The name the file gets as an asset on a release.
13+ - ` tag ` : The tag to uploaded into. If you want the current event's tag, use ` ${{ github.event.ref }} `
14+ - ` overwrite ` : If an asset with name already exists, overwrite it.
1515
1616## Usage
1717
@@ -20,68 +20,72 @@ This is a common use case as you will want to upload release binaries for your t
2020
2121Simple example:
2222
23- name: Publish
24-
25- on:
26- create:
27- tags:
28-
29- jobs:
30- build:
31- name: Publish binaries
32- runs-on: ubuntu-latest
33-
34- steps:
35- - uses: hecrj/setup-rust-action@master
36- with:
37- rust-version: stable
38- - uses: actions/checkout@v1
39- - name: Build
40- run: cargo build --release
41- - name: Upload binaries to release
42- uses: svenstaro/upload-release-action@v1-release
43- with:
44- repo_token: ${{ secrets.GITHUB_TOKEN }}
45- file: target/release/mything
46- asset_name: mything
47- tag: {{ github.event.ref }}
48- overwrite: true
23+ ``` yaml
24+ name : Publish
25+
26+ on :
27+ create :
28+ tags :
29+
30+ jobs :
31+ build :
32+ name : Publish binaries
33+ runs-on : ubuntu-latest
34+
35+ steps :
36+ - uses : hecrj/setup-rust-action@v1-release
37+ with :
38+ rust-version : stable
39+ - uses : actions/checkout@v1
40+ - name : Build
41+ run : cargo build --release
42+ - name : Upload binaries to release
43+ uses : svenstaro/upload-release-action@v1-release
44+ with :
45+ repo_token : ${{ secrets.GITHUB_TOKEN }}
46+ file : target/release/mything
47+ asset_name : mything
48+ tag : {{ github.event.ref }}
49+ overwrite : true
50+ ` ` `
4951
5052Complex example with more operating systems:
5153
52- name: Publish
53-
54- on:
55- create:
56- tags:
57-
58- jobs:
59- build:
60- name: Publish for ${{ matrix.os }}
61- runs-on: ${{ matrix.os }}
62- strategy:
63- matrix:
64- include:
65- - os: ubuntu-latest
66- artifact_name: mything
67- asset_name: mything-linux-amd64
68- - os: windows-latest
69- artifact_name: mything.exe
70- asset_name: mything-windows-amd64
71- - os: macos-latest
72- artifact_name: mything
73- asset_name: mything-macos-amd64
74-
75- steps:
76- - uses: hecrj/setup-rust-action@master
77- with:
78- rust-version: stable
79- - uses: actions/checkout@v1
80- - name: Build
81- run: cargo build --release
82- - name: Upload binaries to release
83- uses: svenstaro/upload-release-action@v1-release
84- with:
85- repo_token: ${{ secrets.GITHUB_TOKEN }}
86- file: target/release/${{ matrix.artifact_name }}
87- asset_name: ${{ matrix.asset_name }}
54+ ` ` ` yaml
55+ name : Publish
56+
57+ on :
58+ create :
59+ tags :
60+
61+ jobs :
62+ build :
63+ name : Publish for ${{ matrix.os }}
64+ runs-on : ${{ matrix.os }}
65+ strategy :
66+ matrix :
67+ include :
68+ - os : ubuntu-latest
69+ artifact_name : mything
70+ asset_name : mything-linux-amd64
71+ - os : windows-latest
72+ artifact_name : mything.exe
73+ asset_name : mything-windows-amd64
74+ - os : macos-latest
75+ artifact_name : mything
76+ asset_name : mything-macos-amd64
77+
78+ steps :
79+ - uses : hecrj/setup-rust-action@v1-release
80+ with :
81+ rust-version : stable
82+ - uses : actions/checkout@v1
83+ - name : Build
84+ run : cargo build --release
85+ - name : Upload binaries to release
86+ uses : svenstaro/upload-release-action@v1-release
87+ with :
88+ repo_token : ${{ secrets.GITHUB_TOKEN }}
89+ file : target/release/${{ matrix.artifact_name }}
90+ asset_name : ${{ matrix.asset_name }}
91+ ` ` `
0 commit comments