-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (48 loc) · 1.56 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: Publish
on:
push:
tags:
- '*'
jobs:
build:
name: Release
runs-on: ubuntu-latest
permissions: write-all
strategy:
fail-fast: false
matrix:
os: [ windows-x86_64, linux-x86_64 ]
include:
- os: linux-x86_64
target: x86_64-unknown-linux-gnu
artifact_name: universal-explorer
asset_name: universal-explorer_linux_x86_64
- os: windows-x86_64
target: x86_64-pc-windows-msvc
artifact_name: universal-explorer.exe
asset_name: universal-explorer_win_x86_64.exe
linker_package: gcc-mingw-w64-x86-64
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Install linker
if: matrix.linker_package != null
run: sudo apt-get install -y ${{ matrix.linker_package }}
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Build project
run: cargo build --release --target ${{ matrix.target }}
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true
body: "Release for ${{ matrix.os }}"