-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.48 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build and Release
on:
push:
tags:
- "*.*.*"
jobs:
release:
name: Release on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform: [macos-x86_64, linux-x86_64, windows-x86_64]
include:
- platform: macos-x86_64
target: x86_64-apple-darwin
os: macos-latest
bin: h2sr
- platform: linux-x86_64
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
bin: h2sr
- platform: windows-x86_64
target: x86_64-pc-windows-msvc
os: windows-latest
bin: h2sr.exe
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Checkout code
uses: actions/checkout@v1
- name: Run code build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --release --target ${{ matrix.target }}
- name: Prepare assets
shell: bash
run: |
cd target/${{ matrix.target }}/release
strip ${{ matrix.bin }}
tar czvf h2sr-${{ matrix.platform }}.tar.gz ${{ matrix.bin }}
- name: Release assets
uses: softprops/action-gh-release@v1
with:
files: target/${{ matrix.target }}/release/h2sr-${{ matrix.platform }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}