Skip to content
Merged
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
102 changes: 102 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
sudo apt-get update
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libpipewire-0.3-dev libspa-0.2-dev libasound2-dev

- name: Install cargo-deb
if: runner.os == 'Linux'
run: cargo install cargo-deb --locked

- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install openssl@3 portaudio
Expand All @@ -82,6 +86,15 @@ jobs:
cd ../../..
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.tar.gz.sha256

- name: Package Debian (.deb)
if: runner.os == 'Linux'
shell: bash
run: |
cargo deb --no-build --target ${{ matrix.target }}
DEB_PATH=$(ls target/${{ matrix.target }}/debian/*.deb)
cp "$DEB_PATH" .
sha256sum "$(basename "$DEB_PATH")" > "$(basename "$DEB_PATH").sha256"

- name: Package binary (Windows)
if: runner.os == 'Windows'
shell: bash
Expand All @@ -102,6 +115,15 @@ jobs:
${{ env.BINARY_NAME }}-${{ matrix.artifact_prefix }}.tar.gz
${{ env.BINARY_NAME }}-${{ matrix.artifact_prefix }}.tar.gz.sha256

- name: Upload artifact (Linux .deb)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v6
with:
name: ${{ env.BINARY_NAME }}-${{ matrix.artifact_prefix }}-deb
path: |
*.deb
*.deb.sha256

- name: Upload artifact (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v6
Expand Down Expand Up @@ -232,3 +254,83 @@ jobs:
git add PKGBUILD .SRCINFO
git commit -m "Update to ${{ steps.version.outputs.version }}"
GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' git push

publish-aur-bin:
name: Publish to AUR (spotatui-bin)
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6

- name: Extract version
id: version
run: |
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Calculate SHA256 checksums
id: sha256
run: |
VERSION="${{ steps.version.outputs.version }}"

# SHA256 for the binary tarball
BINARY_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/spotatui-linux-x86_64.tar.gz"
SHA256_BINARY=$(curl -sL "$BINARY_URL" | sha256sum | awk '{print $1}')
echo "sha256_binary=$SHA256_BINARY" >> $GITHUB_OUTPUT
echo "Binary SHA256: $SHA256_BINARY"

# SHA256 for LICENSE
LICENSE_URL="https://raw.githubusercontent.com/${{ github.repository }}/v${VERSION}/LICENSE"
SHA256_LICENSE=$(curl -sL "$LICENSE_URL" | sha256sum | awk '{print $1}')
echo "sha256_license=$SHA256_LICENSE" >> $GITHUB_OUTPUT
echo "LICENSE SHA256: $SHA256_LICENSE"

# SHA256 for README.md
README_URL="https://raw.githubusercontent.com/${{ github.repository }}/v${VERSION}/README.md"
SHA256_README=$(curl -sL "$README_URL" | sha256sum | awk '{print $1}')
echo "sha256_readme=$SHA256_README" >> $GITHUB_OUTPUT
echo "README SHA256: $SHA256_README"

- name: Setup SSH for AUR
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
git config --global user.name "${{ secrets.AUR_USERNAME }}"
git config --global user.email "${{ secrets.AUR_EMAIL }}"

- name: Clone AUR repository
run: |
GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' git clone ssh://aur@aur.archlinux.org/spotatui-bin.git aur-bin

- name: Update PKGBUILD
working-directory: aur-bin
run: |
sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
# Remove old multi-line sha256sums and insert new single-line version
sed -i '/^sha256sums=/,/)/d' PKGBUILD
sed -i "/^sha256sums_x86_64=/i sha256sums=('${{ steps.sha256.outputs.sha256_license }}' '${{ steps.sha256.outputs.sha256_readme }}')" PKGBUILD
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${{ steps.sha256.outputs.sha256_binary }}')/" PKGBUILD

- name: Generate .SRCINFO
working-directory: aur-bin
run: |
docker run --rm -v $PWD:/pkg archlinux:latest /bin/bash -c "
pacman -Syu --noconfirm --needed base-devel &&
useradd -m builder &&
chown -R builder:builder /pkg &&
cd /pkg &&
su builder -c 'makepkg --printsrcinfo' > .SRCINFO
"
sudo chown -R $(id -u):$(id -g) .

- name: Commit and push to AUR
working-directory: aur-bin
run: |
git add PKGBUILD .SRCINFO
git commit -m "Update to ${{ steps.version.outputs.version }}"
GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' git push
83 changes: 83 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,86 @@ jobs:
git add PKGBUILD .SRCINFO
git commit -m "Update to ${{ steps.version.outputs.version }}"
GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' git push

publish-aur-bin:
name: Publish to AUR (spotatui-bin)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6

- name: Extract version
id: version
run: |
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Calculate SHA256 checksums
id: sha256
run: |
VERSION="${{ steps.version.outputs.version }}"

# SHA256 for the binary tarball
BINARY_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/spotatui-linux-x86_64.tar.gz"
SHA256_BINARY=$(curl -sL "$BINARY_URL" | sha256sum | awk '{print $1}')
echo "sha256_binary=$SHA256_BINARY" >> $GITHUB_OUTPUT
echo "Binary SHA256: $SHA256_BINARY"

# SHA256 for LICENSE
LICENSE_URL="https://raw.githubusercontent.com/${{ github.repository }}/v${VERSION}/LICENSE"
SHA256_LICENSE=$(curl -sL "$LICENSE_URL" | sha256sum | awk '{print $1}')
echo "sha256_license=$SHA256_LICENSE" >> $GITHUB_OUTPUT
echo "LICENSE SHA256: $SHA256_LICENSE"

# SHA256 for README.md
README_URL="https://raw.githubusercontent.com/${{ github.repository }}/v${VERSION}/README.md"
SHA256_README=$(curl -sL "$README_URL" | sha256sum | awk '{print $1}')
echo "sha256_readme=$SHA256_README" >> $GITHUB_OUTPUT
echo "README SHA256: $SHA256_README"

- name: Setup SSH for AUR
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
git config --global user.name "${{ secrets.AUR_USERNAME }}"
git config --global user.email "${{ secrets.AUR_EMAIL }}"

- name: Clone AUR repository
run: |
GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' git clone ssh://aur@aur.archlinux.org/spotatui-bin.git aur-bin

- name: Update PKGBUILD
working-directory: aur-bin
run: |
sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
# Remove old multi-line sha256sums and insert new single-line version
sed -i '/^sha256sums=/,/)/d' PKGBUILD
sed -i "/^sha256sums_x86_64=/i sha256sums=('${{ steps.sha256.outputs.sha256_license }}' '${{ steps.sha256.outputs.sha256_readme }}')" PKGBUILD
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${{ steps.sha256.outputs.sha256_binary }}')/" PKGBUILD

- name: Generate .SRCINFO
working-directory: aur-bin
run: |
docker run --rm -v $PWD:/pkg archlinux:latest /bin/bash -c "
pacman -Syu --noconfirm --needed base-devel &&
useradd -m builder &&
chown -R builder:builder /pkg &&
cd /pkg &&
su builder -c 'makepkg --printsrcinfo' > .SRCINFO
"
sudo chown -R $(id -u):$(id -g) .

- name: Commit and push to AUR
working-directory: aur-bin
run: |
git add PKGBUILD .SRCINFO
git commit -m "Update to ${{ steps.version.outputs.version }}"
GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' git push
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## [0.35.3] - 2026-01-22
## [0.35.4] - 2026-01-24

### Added

- **Discord Rich Presence**: Show track info, album art, and a GitHub callout in Discord; enabled by default with a built-in application ID and optional overrides via config/env.
- **AUR Binary Package**: `spotatui-bin` is now automatically published alongside releases for faster installation on Arch Linux.

## [0.35.3] - 2026-01-24

### Added

Expand Down
35 changes: 30 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 17 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ documentation = "https://github.com/LargeModGames/spotatui"
repository = "https://github.com/LargeModGames/spotatui"
keywords = ["spotify", "tui", "cli", "terminal"]
categories = ["command-line-utilities"]
version = "0.35.3"
version = "0.35.4"
authors = ["LargeModGames <LargeModGames@gmail.com>"]
edition = "2021"
license = "MIT"
exclude = [
".github/demo.gif",
".github/workflows",
".github/ISSUE_TEMPLATE",
"target/",
"snap/",
".github/demo.gif",
".github/workflows",
".github/ISSUE_TEMPLATE",
"target/",
"snap/",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down Expand Up @@ -46,6 +46,7 @@ reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-feature
openssl = { version = "0.10", optional = true }
cpal = { version = "0.17", optional = true }
realfft = { version = "3.4", optional = true }
discord-rich-presence = { version = "1.0", optional = true }

# Streaming dependencies (librespot)
# Pin vergen crates to versions compatible with librespot-core 0.8's build.rs
Expand Down Expand Up @@ -88,7 +89,7 @@ objc2 = { version = "0.6", optional = true }
block2 = { version = "0.6", optional = true }

[features]
default = ["telemetry", "streaming", "audio-viz-cpal", "mpris", "macos-media"]
default = ["telemetry", "streaming", "audio-viz-cpal", "mpris", "macos-media", "discord-rpc"]
telemetry = ["reqwest", "reqwest/rustls-tls"]
streaming = ["librespot-core", "librespot-playback", "librespot-connect", "librespot-oauth", "librespot-metadata"]
# Audio backend features
Expand All @@ -104,6 +105,7 @@ audio-viz = ["realfft", "pipewire"]
audio-viz-cpal = ["realfft", "cpal"] # Alternative for Windows/macOS or if pipewire issues
mpris = ["mpris-server", "streaming"] # MPRIS D-Bus integration (Linux only, requires streaming)
macos-media = ["objc2-media-player", "objc2-foundation", "objc2", "block2", "streaming"] # macOS Now Playing integration
discord-rpc = ["discord-rich-presence"]

[target.'cfg(target_env = "musl")'.dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
Expand All @@ -118,3 +120,11 @@ codegen-units = 1 # Better optimization
lto = true # Link-time optimization
opt-level = "s" # Prioritize small binary size
strip = true # Remove debug symbols

[package.metadata.deb]
maintainer = "LargeModGames <LargeModGames@gmail.com>"
copyright = "2025, LargeModGames"
license-file = ["LICENSE", "4"]
depends = "$auto"
section = "utils"
priority = "optional"
Loading
Loading