chore(release): v2.0.0

This commit is contained in:
marwy 2026-11-29 02:28:03 +03:00
parent a6f33284a7
commit 7fbf34ff2e
81 changed files with 16727 additions and 3280 deletions

61
packaging/build-appimage.sh Executable file
View file

@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
export PATH="$HOME/.cargo/bin:$PATH"
if [[ "$PROJECT_DIR" == /mnt/* ]]; then
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$HOME/.cache/yandex-music-rs-target}"
else
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$PROJECT_DIR/target}"
fi
VERSION="$(sed -n 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$PROJECT_DIR/Cargo.toml" | head -n 1)"
ARCH="$(uname -m)"
cd "$PROJECT_DIR"
cargo build --release --bin yandex-music-rs
cargo build --release --features linux-webview --bin yandex-music-auth
WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
APPDIR="$WORK/AppDir"
install -Dm755 "$CARGO_TARGET_DIR/release/yandex-music-rs" "$APPDIR/usr/bin/yandex-music-rs"
install -Dm755 "$CARGO_TARGET_DIR/release/yandex-music-auth" "$APPDIR/usr/bin/yandex-music-auth"
install -Dm644 "$PROJECT_DIR/packaging/yandex-music-rs.desktop" "$APPDIR/yandex-music-rs.desktop"
sed -i 's|^Exec=/usr/bin/yandex-music-rs|Exec=yandex-music-rs|' "$APPDIR/yandex-music-rs.desktop"
install -Dm644 "$APPDIR/yandex-music-rs.desktop" "$APPDIR/usr/share/applications/yandex-music-rs.desktop"
install -Dm644 "$PROJECT_DIR/packaging/ru.marwy.YandexMusicRs.metainfo.xml" \
"$APPDIR/usr/share/metainfo/ru.marwy.YandexMusicRs.metainfo.xml"
install -Dm644 "$PROJECT_DIR/packaging/icons/256x256.png" "$APPDIR/yandex-music-rs.png"
ln -sf "yandex-music-rs.png" "$APPDIR/.DirIcon"
install -Dm644 "$PROJECT_DIR/assets/icons/app_48.png" "$APPDIR/usr/share/icons/hicolor/48x48/apps/yandex-music-rs.png"
install -Dm644 "$PROJECT_DIR/packaging/icons/64x64.png" "$APPDIR/usr/share/icons/hicolor/64x64/apps/yandex-music-rs.png"
install -Dm644 "$PROJECT_DIR/packaging/icons/128x128.png" "$APPDIR/usr/share/icons/hicolor/128x128/apps/yandex-music-rs.png"
install -Dm644 "$PROJECT_DIR/packaging/icons/256x256.png" "$APPDIR/usr/share/icons/hicolor/256x256/apps/yandex-music-rs.png"
cat > "$APPDIR/AppRun" <<'EOF'
#!/usr/bin/env sh
HERE="$(dirname "$(readlink -f "$0")")"
export PATH="$HERE/usr/bin:$PATH"
exec "$HERE/usr/bin/yandex-music-rs" "$@"
EOF
chmod 755 "$APPDIR/AppRun"
APPIMAGETOOL="${APPIMAGETOOL:-$(command -v appimagetool || true)}"
if [[ -z "$APPIMAGETOOL" ]]; then
APPIMAGETOOL="$WORK/appimagetool"
echo "Downloading appimagetool..."
curl -fsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage" -o "$APPIMAGETOOL"
chmod +x "$APPIMAGETOOL"
fi
OUT_DIR="$PROJECT_DIR/target/appimage"
mkdir -p "$OUT_DIR"
OUT_FILE="$OUT_DIR/yandex-music-rs-v${VERSION}-linux-${ARCH}.AppImage"
ARCH="$ARCH" "$APPIMAGETOOL" --appimage-extract-and-run "$APPDIR" "$OUT_FILE"
ls -lh "$OUT_FILE"