56 lines (47 loc) 路 1.38 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
name: Release
on:
push:
tags:
- "*"
jobs:
build:
name: Release binary
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cross build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --verbose
- name: Package binaries
run: |
src=$(pwd)
stage=$(mktemp -d)
cp target/${{ matrix.target }}/release/racco $stage/
cd $stage
tar czf $src/racco-${{ github.ref_name }}-${{ matrix.target }}.tar.gz *
cd $src
rm -rf $stage
- name: Upload binaries to release
uses: svenstaro/upload-release-action@2.1.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: racco-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
asset_name: racco-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
tag: ${{ github.ref }}
prerelease: true