11
11
runs-on : ${{ matrix.os }}
12
12
strategy :
13
13
matrix :
14
- build_target : [macos, macos-rodio, linux]
14
+ build_target : [macos, macos-rodio, linux, linux-armhf, linux-armv6 ]
15
15
rust : [stable]
16
16
artifact_type : ['slim', 'full'] # The build strategy will build both types for each OS specified
17
17
include :
@@ -34,22 +34,92 @@ jobs:
34
34
artifact_prefix : linux
35
35
audio_backend : alsa
36
36
target : x86_64-unknown-linux-gnu
37
+ - build_target : linux-armhf
38
+ os : ubuntu-18.04
39
+ artifact_prefix : linux-armhf
40
+ audio_backend : alsa
41
+ target : arm-unknown-linux-gnueabihf
42
+ - build_target : linux-armv6
43
+ os : ubuntu-18.04
44
+ artifact_prefix : linux-armv6
45
+ audio_backend : alsa
46
+ target : arm-unknown-linux-gnueabihf
47
+ exclude :
48
+ - build_target : linux-armv6
49
+ artifact_type : ' full' # Raspberry Pi toolchain is too old for dbus/systemd
37
50
38
51
steps :
39
52
- name : Installing Rust toolchain
40
53
uses : actions-rs/toolchain@v1
41
54
with :
42
55
toolchain : ${{ matrix.rust }}
56
+ target : ${{ matrix.target }}
43
57
override : true
44
58
- name : Installing needed macOS dependencies
45
59
if : matrix.os == 'macos-latest'
46
60
run : brew install awk dbus pkg-config portaudio
47
61
- name : Installing needed Ubuntu dependencies
48
- if : matrix.os == 'ubuntu-latest'
62
+ if : matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04'
49
63
run : |
50
64
sudo apt-get update
51
65
sudo apt-get install -y -qq libasound2-dev libssl-dev libpulse-dev libdbus-1-dev
52
-
66
+ - name : Installing needed Ubuntu armhf dependencies
67
+ if : matrix.os == 'ubuntu-18.04' && matrix.build_target == 'linux-armhf'
68
+ run : |
69
+ sudo mkdir -p /build/sysroot
70
+ echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main" | sudo tee -a /etc/apt/sources.list
71
+ sudo apt-get update
72
+ sudo apt-get install -y -qq gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
73
+ sudo apt-get download libasound2:armhf libasound2-dev:armhf libssl-dev:armhf libssl1.1:armhf
74
+ sudo dpkg -x libasound2_*.deb /build/sysroot/
75
+ sudo dpkg -x libssl-dev*.deb /build/sysroot/
76
+ sudo dpkg -x libssl1.1*.deb /build/sysroot/
77
+ sudo dpkg -x libasound2-dev*.deb /build/sysroot/
78
+ echo "::set-env name=PKG_CONFIG_ALLOW_CROSS::1"
79
+ echo "::set-env name=RUSTFLAGS::-C linker=arm-linux-gnueabihf-gcc -L/usr/arm-linux-gnueabihf/lib -L/build/sysroot/usr/lib/arm-linux-gnueabihf -L/build/sysroot/lib/arm-linux-gnueabihf"
80
+ echo "::set-env name=C_INCLUDE_PATH::/build/sysroot/usr/include"
81
+ echo "::set-env name=OPENSSL_LIB_DIR::/build/sysroot/usr/lib/arm-linux-gnueabihf"
82
+ echo "::set-env name=OPENSSL_INCLUDE_DIR::/build/sysroot/usr/include/arm-linux-gnueabihf"
83
+ - name : Installing needed Ubuntu armv6 dependencies
84
+ if : matrix.os == 'ubuntu-18.04' && matrix.build_target == 'linux-armv6'
85
+ run : |
86
+ sudo mkdir -p /build/sysroot
87
+ echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main" | sudo tee -a /etc/apt/sources.list
88
+ sudo apt-get update
89
+ sudo apt-get install -y -qq git
90
+ sudo git -C /build clone --depth=1 https://github.com/raspberrypi/tools.git
91
+ sudo apt-get download libasound2:armhf libasound2-dev:armhf libssl-dev:armhf libssl1.1:armhf
92
+ sudo dpkg -x libasound2_*.deb /build/sysroot/
93
+ sudo dpkg -x libssl-dev*.deb /build/sysroot/
94
+ sudo dpkg -x libssl1.1*.deb /build/sysroot/
95
+ sudo dpkg -x libasound2-dev*.deb /build/sysroot/
96
+ echo "::add-path::/build/tools/arm-bcm2708/arm-linux-gnueabihf/bin"
97
+ echo "::set-env name=PKG_CONFIG_ALLOW_CROSS::1"
98
+ echo "::set-env name=RUSTFLAGS::-C linker=/build/tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -L/build/tools/arm-bcm2708/arm-linux-gnueabihf/arm-linux-gnueabihf/sysroot/lib -L/build/tools/arm-bcm2708/arm-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib -L/build/sysroot/usr/lib/arm-linux-gnueabihf -L/build/sysroot/lib/arm-linux-gnueabihf"
99
+ echo "::set-env name=C_INCLUDE_PATH::/build/sysroot/usr/include"
100
+ echo "::set-env name=OPENSSL_LIB_DIR::/build/sysroot/usr/lib/arm-linux-gnueabihf"
101
+ echo "::set-env name=OPENSSL_INCLUDE_DIR::/build/sysroot/usr/include/arm-linux-gnueabihf"
102
+ - name : Installing needed Ubuntu armhf dependencies (full)
103
+ if : matrix.os == 'ubuntu-18.04' && matrix.build_target == 'linux-armhf' && matrix.artifact_type == 'full'
104
+ run : |
105
+ # Make dbus-rs cross-compile, see https://github.com/diwic/dbus-rs/issues/184#issuecomment-520228758
106
+ sudo apt-get download libdbus-1-dev:armhf libdbus-1-3:armhf libsystemd0:armhf libgcrypt20:armhf liblzma5:armhf liblz4-1:armhf libgpg-error0:armhf
107
+ sudo dpkg -x libdbus-1-3*.deb /build/sysroot/
108
+ sudo dpkg -x libdbus-1-dev*.deb /build/sysroot/
109
+ sudo dpkg -x libsystemd0*.deb /build/sysroot/
110
+ sudo dpkg -x libgcrypt20_*.deb /build/sysroot/
111
+ sudo dpkg -x liblzma5_*.deb /build/sysroot/
112
+ sudo dpkg -x liblz4-1_*.deb /build/sysroot/
113
+ sudo dpkg -x libgpg-error0_*.deb /build/sysroot/
114
+ sudo cp -r /build/sysroot/lib/* /build/sysroot/usr/lib/
115
+ sudo ln -frs /build/sysroot/lib/arm-linux-gnueabihf/libdbus-1.so.3 /build/sysroot/lib/arm-linux-gnueabihf/libdbus-1.so
116
+ sudo ln -rs /build/sysroot/lib/arm-linux-gnueabihf/libgcrypt.so.20 /build/sysroot/lib/arm-linux-gnueabihf/libgcrypt.so
117
+ sudo ln -rs /build/sysroot/lib/arm-linux-gnueabihf/libgpg-error.so.0 /build/sysroot/lib/arm-linux-gnueabihf/libgpg-error.so
118
+ sudo ln -rs /build/sysroot/lib/arm-linux-gnueabihf/liblzma.so.5 /build/sysroot/lib/arm-linux-gnueabihf/liblzma.so
119
+ sudo ln -rs /build/sysroot/lib/arm-linux-gnueabihf/libsystemd.so.0 /build/sysroot/lib/arm-linux-gnueabihf/libsystemd.so
120
+ sudo ln -rs /build/sysroot/usr/lib/arm-linux-gnueabihf/liblz4.so.1 /build/sysroot/usr/lib/arm-linux-gnueabihf/liblz4.so
121
+ sudo mkdir -p /.cargo
122
+ echo -e '[target.arm-unknown-linux-gnueabihf.dbus]\nrustc-link-lib = ["dbus-1", "gcrypt", "gpg-error", "lz4", "lzma", "systemd"]' | sudo tee -a /.cargo/config
53
123
- name : Checking out sources
54
124
uses : actions/checkout@v1
55
125
- name : Running cargo build
@@ -58,16 +128,12 @@ jobs:
58
128
command : build
59
129
toolchain : ${{ matrix.rust }}
60
130
args : --locked --release --target ${{ matrix.target }} --no-default-features --features "${{ matrix.feature }},${{ matrix.audio_backend }}_backend"
61
-
62
131
- name : Packaging final binary
63
132
shell : bash
64
133
run : |
65
134
cd target/${{ matrix.target }}/release
66
-
67
- strip spotifyd
68
135
tar czvf spotifyd-${{ matrix.artifact_prefix }}-${{ matrix.artifact_type }}.tar.gz spotifyd
69
136
shasum -a 512 spotifyd-${{ matrix.artifact_prefix }}-${{ matrix.artifact_type }}.tar.gz > spotifyd-${{ matrix.artifact_prefix }}-${{ matrix.artifact_type }}.sha512
70
-
71
137
- name : Releasing assets
72
138
uses : softprops/action-gh-release@v1
73
139
with :
0 commit comments