Skip to content

Commit 32587d0

Browse files
Build and release on tag push (#27)
* Build project on tag push * Update target name * Update target name * Update .github/workflows/rust.yml Co-authored-by: Christian Gill <[email protected]> Co-authored-by: Christian Gill <[email protected]>
1 parent eb5e794 commit 32587d0

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/rust.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,40 @@ jobs:
9898
uses: actions-rs/cargo@v1
9999
with:
100100
command: clippy
101-
args: -- -D warnings
101+
args: -- -D warnings
102+
103+
release:
104+
name: Release
105+
if: startsWith(github.ref, 'refs/tags/')
106+
runs-on: ubuntu-latest
107+
strategy:
108+
matrix:
109+
rust:
110+
- stable
111+
steps:
112+
- name: Checkout sources
113+
uses: actions/checkout@v1
114+
115+
- name: Install toolchain
116+
uses: actions-rs/toolchain@v1
117+
with:
118+
toolchain: ${{ matrix.rust }}
119+
override: true
120+
121+
- uses: actions/cache@v2
122+
with:
123+
path: |
124+
~/.cargo/registry
125+
~/.cargo/git
126+
target
127+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
128+
129+
- name: Build
130+
run: cargo build --all --release && strip target/release/thresh && mv target/release/thresh target/release/thresh_x86-64-linux
131+
132+
- name: Release
133+
uses: softprops/action-gh-release@v1
134+
with:
135+
files: target/release/thresh_x86-64-linux
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)