-
-
Notifications
You must be signed in to change notification settings - Fork 37
77 lines (74 loc) · 2.53 KB
/
build-package.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
name: build-package
on:
push:
tags:
- v*
jobs:
build-linux:
name: Build for Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/[email protected]
with:
crate: cargo-deb
use-tool-cache: true
- uses: actions-rs/cargo@v1
with:
command: deb
args: -- --all-features
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_amd64.bin.xz" target/release/moproxy
- uses: ncipollo/release-action@v1
with:
artifacts: target/debian/*.deb,target/release/*.bin.xz
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
build-windows:
name: Build for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- run: xz -kf target/release/moproxy.exe > "moproxy_${GITHUB_REF#*/v}_windows_amd64.exe.xz"
- uses: ncipollo/release-action@v1
with:
artifacts: target/release/*.exe.xz
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
build-linux-cross:
name: Cross-build for various on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target x86_64-unknown-linux-musl --release
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target armv7-unknown-linux-gnueabihf --release
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target aarch64-linux-android --release
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target mips-unknown-linux-musl --release
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_x86_64_musl.bin.xz" target/x86_64-unknown-linux-musl/release/moproxy
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_armv7_gnueabihf.bin.xz" target/armv7-unknown-linux-gnueabihf/release/moproxy
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_aarch64_android.bin.xz" target/aarch64-linux-android/release/moproxy
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_mips_musl.bin.xz" target/mips-unknown-linux-musl/release/moproxy
- uses: ncipollo/release-action@v1
with:
artifacts: "target/**/*.bin.xz"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true