Bring spotty closer to librespot to simplify future updates. Basic pl… #143
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-11.0 | |
steps: | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Write Build Configuration File | |
uses: DamianReeves/write-file-action@v1.0 | |
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@v2 | |
with: | |
name: spotty-mac | |
path: releases/ | |
Linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Write Build Configuration File | |
uses: DamianReeves/write-file-action@v1.0 | |
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@v2 | |
with: | |
name: spotty-linux | |
path: releases/ | |
windows: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Write Build Configuration File | |
uses: DamianReeves/write-file-action@v1.0 | |
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@v2 | |
with: | |
name: spotty.exe | |
path: target/release/spotty.exe |