From 06e2ccc22cbeaf97c77393720f0ac0a588cf79fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20M=C3=A9ndez?= Date: Sat, 13 Jun 2026 01:09:58 -0600 Subject: [PATCH 1/2] chore: Improving build process --- .github/workflows/build-deb.yml | 124 ++++++++++++++++++++++++++++---- debian/changelog | 2 +- 2 files changed, 113 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index ed94963..8293e56 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -1,5 +1,8 @@ name: Build Deb package +permissions: + contents: write + on: workflow_dispatch: push: @@ -7,44 +10,141 @@ on: tags: - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 +env: + EXTRA_BUILD_DEPS: dh-python dh-cmake + jobs: - build-x86_64: - runs-on: ubuntu-22.04 + build-x86_64-bookworm: + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Set package version for bookworm + run: | + sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~bookworm1\) bookworm;/' debian/changelog - name: Build Debian packages uses: jtdor/build-deb-action@v1.8.0 with: # Name of a Docker image or path of a Dockerfile to use for the build container docker-image: debian:bookworm-slim # Extra packages to be installed as build dependencies - extra-build-deps: dh-python dh-cmake + extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} - name: Archive build artifacts uses: actions/upload-artifact@v4 with: - name: build-x86_64 + name: linamp-x86_64-bookworm path: debian/artifacts/* - build-arm64: - runs-on: ubuntu-22.04 + build-x86_64-trixie: + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Set package version for trixie + run: | + sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~trixie1\) trixie;/' debian/changelog + - name: Build Debian packages + uses: jtdor/build-deb-action@v1.8.0 + with: + # Name of a Docker image or path of a Dockerfile to use for the build container + docker-image: debian:trixie-slim + # Extra packages to be installed as build dependencies + extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} + - name: Archive build artifacts + uses: actions/upload-artifact@v4 with: - platforms: arm64 + name: linamp-x86_64-trixie + path: debian/artifacts/* + + build-arm64-bookworm: + runs-on: ubuntu-24.04-arm + + steps: + - uses: actions/checkout@v4 + - name: Set package version for bookworm + run: | + sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~bookworm1\) bookworm;/' debian/changelog - name: Build Debian packages uses: jtdor/build-deb-action@v1.8.0 with: # Name of a Docker image or path of a Dockerfile to use for the build container docker-image: debian:bookworm-slim # Extra packages to be installed as build dependencies - extra-build-deps: dh-python dh-cmake - extra-docker-args: --platform linux/arm64 + extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} + - name: Archive build artifacts + uses: actions/upload-artifact@v4 + with: + name: linamp-arm64-bookworm + path: debian/artifacts/* + + build-arm64-trixie: + runs-on: ubuntu-24.04-arm + + steps: + - uses: actions/checkout@v4 + - name: Set package version for trixie + run: | + sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~trixie1\) trixie;/' debian/changelog + - name: Build Debian packages + uses: jtdor/build-deb-action@v1.8.0 + with: + # Name of a Docker image or path of a Dockerfile to use for the build container + docker-image: debian:trixie-slim + # Extra packages to be installed as build dependencies + extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} - name: Archive build artifacts uses: actions/upload-artifact@v4 with: - name: build-arm64 + name: linamp-arm64-trixie path: debian/artifacts/* + + release: + if: startsWith(github.ref, 'refs/tags/') + needs: + - build-x86_64-bookworm + - build-x86_64-trixie + - build-arm64-bookworm + - build-arm64-trixie + runs-on: ubuntu-24.04 + + steps: + - name: Download all build artifacts + uses: actions/download-artifact@v4 + with: + path: release-artifacts + + - name: Verify and prepare release files + run: | + set -eu + expected_artifacts=4 + actual_artifacts=$(find release-artifacts -mindepth 1 -maxdepth 1 -type d | wc -l) + if [ "$actual_artifacts" -ne "$expected_artifacts" ]; then + echo "Expected $expected_artifacts artifact directories, got $actual_artifacts" + exit 1 + fi + + mkdir -p release + for dir in release-artifacts/linamp-*; do + artifact_name=$(basename "$dir") + arch=$(echo "$artifact_name" | cut -d'-' -f2) + dist=$(echo "$artifact_name" | cut -d'-' -f3) + + for deb in "$dir"/*.deb; do + [ -e "$deb" ] || continue + deb_name=$(basename "$deb" .deb) + cp "$deb" "release/${deb_name}_${dist}_${arch}.deb" + done + done + + deb_count=$(find release -maxdepth 1 -type f -name '*.deb' | wc -l) + if [ "$deb_count" -eq 0 ]; then + echo "No .deb files were prepared for release" + exit 1 + fi + + ls -la release + + - name: Publish GitHub release assets + uses: softprops/action-gh-release@v2 + with: + files: release/*.deb diff --git a/debian/changelog b/debian/changelog index 22d6edc..b1abfa3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linamp (1.4.0) bookworm; urgency=medium +linamp (1.4.0) unstable; urgency=medium * Feature: Spotify Source, use Linamp as a Spotify Connect receiver * UI: New design for Sources menu From 5e29d9c17bb7d1e21fcaa91736c85892583e4afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20M=C3=A9ndez?= Date: Sat, 13 Jun 2026 01:21:39 -0600 Subject: [PATCH 2/2] chore: update actions versions --- .github/workflows/build-deb.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index 8293e56..e4e0fd8 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set package version for bookworm run: | sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~bookworm1\) bookworm;/' debian/changelog @@ -30,7 +30,7 @@ jobs: # Extra packages to be installed as build dependencies extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} - name: Archive build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linamp-x86_64-bookworm path: debian/artifacts/* @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set package version for trixie run: | sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~trixie1\) trixie;/' debian/changelog @@ -51,7 +51,7 @@ jobs: # Extra packages to be installed as build dependencies extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} - name: Archive build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linamp-x86_64-trixie path: debian/artifacts/* @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-24.04-arm steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set package version for bookworm run: | sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~bookworm1\) bookworm;/' debian/changelog @@ -72,7 +72,7 @@ jobs: # Extra packages to be installed as build dependencies extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} - name: Archive build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linamp-arm64-bookworm path: debian/artifacts/* @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-24.04-arm steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set package version for trixie run: | sed -i -E '1 s/\(([^)]+)\) [^;]+;/\(\1~trixie1\) trixie;/' debian/changelog @@ -93,7 +93,7 @@ jobs: # Extra packages to be installed as build dependencies extra-build-deps: ${{ env.EXTRA_BUILD_DEPS }} - name: Archive build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linamp-arm64-trixie path: debian/artifacts/* @@ -109,7 +109,7 @@ jobs: steps: - name: Download all build artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: release-artifacts