-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (108 loc) · 3.62 KB
/
rust.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Release
on:
push:
tags:
- v[0-9]+.*
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
env:
# (required)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
strategy:
matrix:
include:
# apple
- target: x86_64-apple-darwin
os: macos-latest
build_tool: cargo
features: web, mimalloc, cross-nat
- target: aarch64-apple-darwin
os: macos-latest
build_tool: cargo
features: web, mimalloc, cross-nat
# windows
- target: x86_64-pc-windows-msvc
os: windows-latest
build_tool: cargo
features: web, mimalloc, cross-nat
- target: i686-pc-windows-msvc
os: windows-latest
build_tool: cargo
features: web, mimalloc, cross-nat
- target: aarch64-pc-windows-msvc
os: windows-latest
build_tool: cargo
features: web, mimalloc, cross-nat
# linux
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
build_tool: cargo
features: web, mimalloc, cross-nat
- target: i686-unknown-linux-musl
os: ubuntu-latest
build_tool: cargo-zigbuild
features: web, mimalloc, cross-nat
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
build_tool: cargo-zigbuild
features: web, mimalloc, cross-nat
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
build_tool: cargo-zigbuild
features: web, mimalloc, cross-nat
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: |
sudo apt update -y
sudo apt install -y musl-tools
if: matrix.target == 'x86_64-unknown-linux-musl'
- uses: taiki-e/upload-rust-binary-action@v1
with:
target: ${{ matrix.target }}
# (required)
bin: fubuki
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: unix
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: windows
build_tool: ${{ matrix.build_tool }}
no-default-features: true
features: ${{ matrix.features }}
env:
# (required)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUSTUP_TOOLCHAIN: nightly
CARGO_TERM_COLOR: always
build-android:
runs-on: ubuntu-latest
strategy:
matrix:
target: [
aarch64-linux-android,
armv7-linux-androideabi,
i686-linux-android,
x86_64-linux-android
]
steps:
- uses: actions/checkout@v4
- run: |
cargo install cross --git https://github.com/cross-rs/cross
echo "build ${{ matrix.target }}"
cross +nightly build --lib --release --no-default-features --features "cross-nat" --target ${{ matrix.target }}
cd target/${{ matrix.target }}/release
tar -czf libfubuki-${{ matrix.target }}.tar.gz libfubukil.so
gh release upload ${{ github.ref_name }} libfubuki-${{ matrix.target }}.tar.gz
env:
GH_TOKEN: ${{ github.token }}
RUSTUP_TOOLCHAIN: nightly
CARGO_TERM_COLOR: always