Skip to content

Commit 7171b22

Browse files
committed
Add release.yml
1 parent d9da30c commit 7171b22

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
name: Release binary
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
target: x86_64-unknown-linux-musl
16+
artifact_name: mocword
17+
asset_name: mocword-x86_64-unknown-linux-musl
18+
- os: ubuntu-latest
19+
target: x86_64-pc-windows-gnu
20+
artifact_name: mocword.exe
21+
asset_name: mocword-x86_64-pc-windows-gnu.exe
22+
- os: macos-latest
23+
target: x86_64-apple-darwin
24+
artifact_name: mocword
25+
asset_name: mocword-x86_64-apple-darwin
26+
27+
runs-on: ${{ matrix.os }}
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
33+
- name: Install stable toolchain
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: stable
37+
override: true
38+
39+
- name: Cross build with all features
40+
uses: actions-rs/cargo@v1
41+
with:
42+
use-cross: true
43+
command: build
44+
args: --release --target ${{ matrix.target }} --all-features --verbose
45+
46+
- name: Upload binaries to release
47+
uses: svenstaro/upload-release-action@2.1.1
48+
with:
49+
repo_token: ${{ secrets.GITHUB_TOKEN }}
50+
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
51+
asset_name: ${{ matrix.asset_name }}
52+
tag: ${{ github.ref }}
53+
overwrite: true

0 commit comments

Comments
 (0)