-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (88 loc) · 3.21 KB
/
compile.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Build binaries
on: [push, pull_request]
jobs:
build-linux-aarch64:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Install
run: |
rustup update
rustup target add aarch64-unknown-linux-gnu
sudo apt-get update ; sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu
- name: Compile
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
run: |
cargo build --release --target=aarch64-unknown-linux-gnu
- name: Copy around
run: |
mkdir release
cp target/aarch64-unknown-linux-gnu/release/hanachan release/hanachan_linux_aarch64 || /bin/true
- name: Upload distribution
uses: actions/upload-artifact@v2
with:
name: release
path: |
release
build-linux-windows:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Install
run: |
rustup update
rustup target add i686-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
#
rustup target add i686-pc-windows-gnu
rustup target add x86_64-pc-windows-gnu
sudo apt-get update ; sudo apt-get install mingw-w64 gcc-multilib
- name: Compile
run: |
cargo build --release --target=i686-unknown-linux-gnu
cargo build --release --target=x86_64-unknown-linux-gnu
#
RUSTFLAGS="-C panic=abort -C embed-bitcode=yes -C lto" cargo build --release --target=i686-pc-windows-gnu
cargo build --release --target=x86_64-pc-windows-gnu
- name: Copy around
run: |
mkdir release
cp target/i686-unknown-linux-gnu/release/hanachan release/hanachan_linux_i686 || /bin/true
cp target/x86_64-unknown-linux-gnu/release/hanachan release/hanachan_linux_x86_64 || /bin/true
#
cp target/i686-pc-windows-gnu/release/hanachan.exe release/hanachan_windows_i686.exe || /bin/true
cp target/x86_64-pc-windows-gnu/release/hanachan.exe release/hanachan_windows_x86_64.exe || /bin/true
- name: Upload distribution
uses: actions/upload-artifact@v2
with:
name: release
path: |
release
build-osx:
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Install
run: |
rustup update
rustup target add x86_64-apple-darwin
# rustup target add aarch64-apple-darwin
- name: Compile
run: |
cargo build --release --target=x86_64-apple-darwin
# cargo build --release --target=aarch64-apple-darwin
- name: Copy around
run: |
mkdir release
cp target/x86_64-apple-darwin/release/hanachan release/hanachan_mac_x86_64 || /bin/true
# cp target/aarch64-apple-darwin/release/hanachan release/hanachan_mac_aarch64 || /bin/true
- name: Upload distribution
uses: actions/upload-artifact@v2
with:
name: release
path: |
release