-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 1.6 KB
/
releases.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
59
60
61
62
63
64
65
name: release
on:
workflow_dispatch:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
jobs:
build-release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
# Darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: .exe
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
target: ${{ matrix.target }}
toolchain: nightly
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
- name: Rename Artifacts
shell: bash
run: |
ver=${GITHUB_REF#refs/tags/}
ASSET_PATH=goup-$ver-${{ matrix.target }}${{ matrix.ext }}
mv target/${{ matrix.target }}/release/goup $ASSET_PATH
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.ASSET_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}