forked from librespot-org/librespot
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.21 KB
/
build_librespot.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
name: Build Librespot (with mass patches) for all platforms
on:
push:
branches: [mass]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
macOS:
runs-on: macos-11.0
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust support for ARM64 & prepare environment
run: |
rustup target add aarch64-apple-darwin
mkdir releases
- name: Build
run: |
cargo build --release
cargo build --target=aarch64-apple-darwin --release
- name: Build fat binary
run: |
lipo -create \
-arch x86_64 target/release/librespot \
-arch arm64 target/aarch64-apple-darwin/release/librespot \
-output releases/librespot-macos-arm64
chmod +x releases/librespot-macos-arm64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: librespot-mac
path: releases/
Linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare build environment
run: |
rustup target add x86_64-unknown-linux-musl
rustup target add i686-unknown-linux-musl
curl -L https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz | tar xvz
mkdir -p releases/linux
- name: "Install musl-tools to provide musl-gcc"
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: "musl-tools"
version: "1.0"
- name: Build x86_64
run: |
cargo build --release --target=x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/librespot releases/linux/librespot-linux-x86_64
chmod +x releases/linux/librespot-linux-x86_64
- name: Build ARMv8
run: |
./cross build --target=aarch64-unknown-linux-musl
cp target/aarch64-unknown-linux-musl/release/librespot releases/linux/librespot-linux-aarch64
chmod +x releases/linux/librespot-linux-aarch64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: librespot-linux
path: releases/