-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (61 loc) · 2.23 KB
/
push.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
66
67
68
69
70
71
72
on:
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
name: compile
jobs:
build:
name: Build artifacts
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-gnu
os: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install linker(aarch64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu
- name: Add rustup target
run: rustup target add ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Move binaries (Linux/MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: mv ./target/${{ matrix.target }}/release/prot-scriber ./${{ matrix.target }}_prot-scriber
- name: Move binaries and generate manual (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
mv ./target/${{ matrix.target }}/release/prot-scriber.exe ./${{ matrix.target }}_prot-scriber.exe
chmod a+x ./${{ matrix.target }}_prot-scriber
./${{ matrix.target }}_prot-scriber --help >> prot-scriber-manual.txt
- name: Binary relase (Linux/MaxOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.target }}_prot-scriber
- name: Relase help-text / manual (Windows)
if: matrix.os == 'windows-latest'
uses: softprops/action-gh-release@v1
with:
files: prot-scriber-manual.txt
- name: Relase (Windows)
if: matrix.os == 'windows-latest'
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.target }}_prot-scriber.exe