forked from librespot-org/librespot
-
Notifications
You must be signed in to change notification settings - Fork 8
108 lines (87 loc) · 2.66 KB
/
build-spotty.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
name: Build Spotty for all platforms
on:
push:
branches: [spotty, spotty-dev]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
KEYMASTER_CLIENT_ID: ${{ secrets.KEYMASTER_CLIENT_ID }}
jobs:
macOS:
runs-on: macos-12
steps:
- name: Install Rust
uses: crusty-pie/toolchain@v1
with:
toolchain: stable
- name: Checkout
uses: actions/checkout@v4
- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.3
with:
path: ./src/client_id.txt
contents: ${{ env.KEYMASTER_CLIENT_ID }}
write-mode: overwrite
- name: Install Rust support for ARM64 & prepare environment
run: |
rustup target add aarch64-apple-darwin
mkdir releases
- name: Build
run: |
cargo build --release
strip target/release/spotty
cp target/release/spotty releases/spotty-x86_64
cargo build --target=aarch64-apple-darwin --release
strip target/aarch64-apple-darwin/release/spotty
cp target/aarch64-apple-darwin/release/spotty releases/spotty-arm64
- name: Build fat binary
run: |
lipo -create \
-arch x86_64 releases/spotty-x86_64 \
-arch arm64 releases/spotty-arm64 \
-output releases/spotty
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: spotty-mac
path: releases/
Linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.3
with:
path: ./src/client_id.txt
contents: ${{ env.KEYMASTER_CLIENT_ID }}
write-mode: overwrite
# - name: Build ARMv7/6/5
# run: docker run --rm -v $(pwd):/source dlecan/rust-crosscompiler-arm:stable
- name: Build other binaries (x86_64, i686, ARMv8)
run: |
docker build -t spotty-cross - < docker/Dockerfile
docker run --rm -v $PWD/target:/build -v $PWD:/src spotty-cross
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: spotty-linux
path: releases/
windows:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.3
with:
path: ./src/client_id.txt
contents: ${{ env.KEYMASTER_CLIENT_ID }}
write-mode: overwrite
- name: Build
run: cargo build --release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: spotty.exe
path: target/release/spotty.exe