Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
tags:
- 'v*.*.*'
- "v*.*.*"

jobs:
build:
Expand All @@ -16,7 +16,7 @@ jobs:
os: [macos, linux]
arch: [x86_64, aarch64, armv7]
rust: [stable]
artifact_type: ['slim', 'default', 'full'] # The build strategy will build all types for each OS specified
artifact_type: ["slim", "default", "full"] # The build strategy will build all types for each OS specified
include:
# Runner configuration
- os: macos
Expand All @@ -32,7 +32,7 @@ jobs:
runs_on: ubuntu-22.04-arm
# DBus configuration
- artifact_type: slim
dbus: ''
dbus: ""
- artifact_type: default
dbus: dbus_mpris
- artifact_type: full
Expand All @@ -56,7 +56,7 @@ jobs:
audio_backends: portaudio_backend,rodio_backend
exclude:
- os: macos
artifact_type: 'full'
artifact_type: "full"
- os: macos
arch: armv7
steps:
Expand Down Expand Up @@ -86,10 +86,23 @@ jobs:
run: |
features="--no-default-features --features ${{ matrix.dbus }},${{ matrix.audio_backends }}"
echo CARGO_ARGS="--locked --release $features" | tee -a "$GITHUB_ENV"
- name: Determine target triple
id: target_triple
shell: bash
run: |
# Use the cross-compilation target if specified
if [ "${{ matrix.target}}" != ""]; then
TARGET_TRIPLE="${{ matrix.target }}"
else
# Get the host target from rustc
TARGET_TRIPLE=$(rustc -vV | grep 'host:' | awk '{print $2}')
fi
echo "target_triple=$TARGET_TRIPLE" >> $GITHUB_OUTPUT
echo "Target triple: $TARGET_TRIPLE"
- name: Build (using cargo)
if: matrix.target == ''
run: |
cargo +${{ matrix.rust }} build $CARGO_ARGS
cargo +${{ matrix.rust }} build $CARGO_ARGS
- name: Build (using cross)
if: matrix.target != ''
uses: houseabsolute/actions-rust-cross@v1
Expand All @@ -99,10 +112,15 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
args: $CARGO_ARGS
- name: Uploading artifacts
- name: Uploading artifacts (new naming)
uses: actions/upload-artifact@v4
with:
name: spotifyd-${{ steps.target_triple.outputs.target_triple }}-${{ matrix.artifact_type }}
path: target/${{ matrix.target }}/release/spotifyd
- name: Uploading artifacts (legacy naming - deprecated)
uses: actions/upload-artifact@v4
with:
name: spotifyd-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.artifact_type }}
name: spotifyd-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.artifact_type }}-legacy
path: target/${{ matrix.target }}/release/spotifyd
release: # only runs when a version tag is pushed
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -128,5 +146,16 @@ jobs:
files: |
**/*.tar.gz
**/*.sha512
body: |
## Asset Naming Change
Starting with this release, we're transitioning to Rust's standard target triple naming convention to support `cargo-binstall`.

**New format:** `spotifyd-{target-triple}-{variant}.tar.gz`
- Example: `spotifyd-x86_64-unknown-linux-gnu-full.tar.gz`

**Legacy format** (deprecated, will be removed in next release): `spotifyd-{os}-{arch}-{variant}.tar.gz`
- Example: `spotifyd-linux-x86_64-full-legacy.tar.gz`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure, but I think the code above will remove -legacy before publishing the release. And probably, if we want to keep a legacy version, this should keep the identical naming as previously.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you’re right, the packaging step removes the -legacy suffix, so legacy artifacts would not retain their original naming and this could lead to confusion or potential naming conflicts. I can remove the artifact_name=${artifact_name%-legacy line so legacy releases keep the -legacy suffix and preserve the previous naming format. Does that approach work for you?


Both formats are available in this release for backwards compatibility.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 36 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[package]
authors = ["Simon Persson <simon@flaskpost.org>", "Sven Lechner <sven.lechner@rwth-aachen.de>", "eladyn <eladyn@protonmail.com>"]
authors = [
"Simon Persson <simon@flaskpost.org>",
"Sven Lechner <sven.lechner@rwth-aachen.de>",
"eladyn <eladyn@protonmail.com>",
]
edition = "2024"
name = "spotifyd"
description = "A Spotify daemon"
Expand All @@ -23,7 +27,12 @@ libc = "0.2.82"
log = "0.4.6"
serde = { version = "1.0.115", features = ["derive"] }
sha-1 = "0.10"
tokio = {version = "1.44.2", features = ["signal", "rt-multi-thread", "process", "io-std"] }
tokio = { version = "1.44.2", features = [
"signal",
"rt-multi-thread",
"process",
"io-std",
] }
tokio-stream = "0.1.7"
url = "2.2.2"
librespot-audio = { version = "0.8.0", default-features = false }
Expand All @@ -38,7 +47,9 @@ toml = "0.9.8"
color-eyre = "0.6"
directories = "6.0.0"
thiserror = "2.0"
time = { version = "0.3.37", default-features = false, features = ["formatting"] }
time = { version = "0.3.37", default-features = false, features = [
"formatting",
] }
clap = { version = "4.5.23", features = ["derive"] }
serde_ignored = "0.1.10"

Expand Down Expand Up @@ -71,9 +82,21 @@ rodiojack_backend = ["librespot-playback/rodiojack-backend"]
depends = "$auto"
features = ["pulseaudio_backend", "dbus_mpris"]
assets = [
["target/release/spotifyd", "usr/bin/", "755"],
["README.md", "usr/share/doc/spotifyd/README", "644"],
["contrib/spotifyd.service", "etc/systemd/user/", "644"],
[
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rather picky, but maybe we can keep the previous formatting of the Cargo.toml file. :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all, I'll revert to the original formatting. Consistency is important.

"target/release/spotifyd",
"usr/bin/",
"755",
],
[
"README.md",
"usr/share/doc/spotifyd/README",
"644",
],
[
"contrib/spotifyd.service",
"etc/systemd/user/",
"644",
],
]

[package.metadata.generate-rpm]
Expand All @@ -83,6 +106,13 @@ assets = [
{ source = "contrib/spotifyd.service", dest = "/etc/systemd/user/spotifyd.service", mode = "644" },
]

# cargo-binstall support
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-full{ archive-suffix }"
bin-dir = "{ bin }{ binary-ext }"
pkg-fmt = "tgz"
disabled-strategies = ["quick-install", "compile"]

[profile.release]
lto = true

Expand Down
37 changes: 32 additions & 5 deletions docs/src/installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
Getting `spotifyd` on your system should be as easy as downloading a binary in most cases.
If you'd like to learn how to compile `spotifyd` yourself, head over to [building from source](./source.md).

## Using cargo-binstall (Optional)

If you have Rust installed, you can quickly install `spotifyd` is using `cargo-binstall`

```console
cargo binstall spotifyd
```

This will automatically download and install the appropriate pre-built binary for your system with all features enabled (`full` variant).

If you don't have `cargo-binstall` installed yet, you can get it with:

```console
cargo install cargo-binstall
```

## Linux

Some linux distributions include `spotifyd` in their official repositories. Have a look at [Repology](https://repology.org/project/spotifyd/versions)
Expand Down Expand Up @@ -41,22 +57,33 @@ and the platform architecture that they were built for. You can find the latest

If you're unsure which version to choose, just go for `default` on desktop systems and `slim` on headless systems.

**Asset Naming Convention:**
Release assets follow Rust's standard target triple naming format: `spotifyd-{target-triple}-{variant}.tar.gz`

Examples:
`spotifyd-x86_64-unknown-linux-gnu-full.tar.gz`
`spotifyd-aarch64-apple-darwin-default.tar.gz`
`spotifyd-armv7-unknown-linux-gnueabihf-slim.tar.gz`

**Architecture:**

If you're on Linux, check your platform architecture with `uname -m`:

- `x86_64`: Download one of the `spotifyd-linux-x86_64-{full,default,slim}.tar.gz` packages.
- `armhf`, `armv7`: Download one of the `spotifyd-linux-armv7-{full,default,slim}.tar.gz` packages.
- `aarch64`: Download one of the `spotifyd-linux-aarch64-{full,default,slim}.tar.gz`
- `x86_64`: Download one of the `spotifyd-x86_64-unknown-linux-gnu-{full,default,slim}.tar.gz` packages.
- `armhf`, `armv7`: Download one of the `spotifyd-armv7-unknown-linux-gnueabihf-{full,default,slim}.tar.gz` packages.
- `aarch64`: Download one of the `spotifyd-aarch64-unknown-linux-gnu-{full,default,slim}.tar.gz`
- `armv6`: Unfortunately, we no longer support this architecture. If you still need this to work, please open an issue or join the [community matrix channel](https://matrix.to/#/#spotifyd:matrix.org) and we'll try to find a solution.

If you're on macOS, download one of the `spotifyd-macos-{full,default,slim}.tar.gz` packages.
If you're on macOS:

- Intel Macs: Download one of the `spotifyd-x86_64-apple-darwin-{default,slim}.tar.gz` packages.

- Apple Silicon Macs: Download one of the `spotifyd-aarch64-apple-darwin-{default,slim}.tar.gz` packages.

You should now extract the downloaded archive, make the `spotifyd` file executable and copy it to a sensible location. This can be done using the following commands:

```console
$ tar xzf spotifyd-*.tar.gz # extract
$ cd spotifyd-*/
$ chmod +x spotifyd # make binary executable
$ # move to correct location, e.g. on Linux:
$ # for a user-wide installation (make sure that your $PATH includes ~/.local/bin)
Expand Down
1 change: 1 addition & 0 deletions src/dbus_mpris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl RepeatState {
}
}


impl From<(bool, bool)> for RepeatState {
fn from((context, track): (bool, bool)) -> Self {
if context {
Expand Down