From 4ec49d822b7c5a10f3f66514c63c0965aeece378 Mon Sep 17 00:00:00 2001 From: arabian Date: Tue, 2 Jun 2026 21:54:29 +0300 Subject: [PATCH] parallel deb packaging --- .github/workflows/build.yml | 33 ++++++++++++++++++ .github/workflows/release.yml | 63 +++++++++++++++++++++++++++++++++-- 2 files changed, 94 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 462da69..ff6e55d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,6 +95,39 @@ jobs: path: pwsp-*.zip retention-days: 7 + deb-build: + runs-on: ubuntu-latest + + steps: + - name: Install apt deps (dev-libs) + run: | + sudo apt-get update + sudo apt-get install -y \ + libpipewire-0.3-dev \ + libclang-dev \ + libasound2-dev \ + libdbus-1-dev \ + pkg-config + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.96.0 + + - name: Build all binaries (debug-speed compilation into target/release) + env: + CARGO_PROFILE_RELEASE_OPT_LEVEL: 0 + CARGO_PROFILE_RELEASE_DEBUG: "true" + CARGO_PROFILE_RELEASE_STRIP: "false" + CARGO_PROFILE_RELEASE_LTO: "false" + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 256 + run: cargo build --release --locked + - name: Cache cargo-deb id: cache-cargo-deb uses: actions/cache@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a63539d..08174df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -131,6 +131,42 @@ jobs: zip -j "$ARCHIVE_NAME" "${FILES[@]}" + - name: Upload zip archive + uses: actions/upload-artifact@v4 + with: + name: zip-archive + path: pwsp-*.zip + retention-days: 1 + + deb-release: + needs: prepare + runs-on: ubuntu-latest + + steps: + - name: Install apt deps (dev-libs) + run: | + sudo apt-get update + sudo apt-get install -y \ + libpipewire-0.3-dev \ + libclang-dev \ + libasound2-dev \ + libdbus-1-dev \ + pkg-config + + - name: Checkout code at tag + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare.outputs.tag }} + fetch-depth: 0 + + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.96.0 + + - name: Build all release binaries + run: cargo build --release --locked + - name: Cache cargo-deb id: cache-cargo-deb uses: actions/cache@v4 @@ -149,11 +185,34 @@ jobs: export PATH="$HOME/.cargo/bin:$PATH" cargo-deb -p pwsp-gui --no-build + - name: Upload deb package + uses: actions/upload-artifact@v4 + with: + name: deb-package + path: target/debian/*.deb + retention-days: 1 + + publish-release: + needs: [prepare, linux-release, deb-release] + runs-on: ubuntu-latest + steps: + - name: Download zip archive + uses: actions/download-artifact@v4 + with: + name: zip-archive + path: ./dist + + - name: Download deb package + uses: actions/download-artifact@v4 + with: + name: deb-package + path: ./dist + - name: Upload artifacts to Release uses: softprops/action-gh-release@v2 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ needs.prepare.outputs.tag }} files: | - pwsp-*.zip - target/debian/*.deb + ./dist/pwsp-*.zip + ./dist/*.deb