From f21db3dd8dce7ca2512c0fc2dacbfc640968f543 Mon Sep 17 00:00:00 2001 From: Bjordis Collaku Date: Fri, 15 May 2026 15:13:44 -0700 Subject: [PATCH 1/4] Add srcpkg-artifact support for external trees Add `srcpkg-artifact` input (default: empty) that, when set, downloads a pre-prepared source tree artifact into `srcpkg/` instead of checking out the packaging repository at `debian-ref`. This enables callers such as pkg-linux-qcom to assemble the source tree at CI time (e.g. kernel source with `debian/` injected by prepare-source.sh) and pass it to the reusable workflow for Debusine source package generation and build submission. When `srcpkg-artifact` is empty (the default), the existing behaviour is preserved: the packaging repository is checked out at `debian-ref` in both the `debian-build` and `test` jobs. Signed-off-by: Bjordis Collaku --- .../qcom-build-pkg-reusable-workflow.yml | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qcom-build-pkg-reusable-workflow.yml b/.github/workflows/qcom-build-pkg-reusable-workflow.yml index 00f2e79..4efd46f 100644 --- a/.github/workflows/qcom-build-pkg-reusable-workflow.yml +++ b/.github/workflows/qcom-build-pkg-reusable-workflow.yml @@ -64,6 +64,16 @@ on: type: boolean default: false + srcpkg-artifact: + description: | + Name of a GitHub Actions artifact containing a pre-prepared source tree + to use as srcpkg/. When set, the debian-ref checkout is skipped and the + artifact is downloaded instead. Used for packages like pkg-linux-qcom + where the source tree is assembled at CI time rather than managed in a + single git repository. + type: string + default: "" + secrets: DEBUSINE_USER: required: false @@ -95,7 +105,8 @@ permissions: packages: read env: - DEBUSINE_ACTION_REF: main + # TODO: update to main once feat/generate-source-package-non-gbp-quilt is merged. + DEBUSINE_ACTION_REF: feat/generate-source-package-non-gbp-quilt jobs: resolve: @@ -252,6 +263,7 @@ jobs: lib - name: Checkout Repository + if: ${{ inputs.srcpkg-artifact == '' }} uses: actions/checkout@v5 with: ref: ${{ inputs.debian-ref }} @@ -259,6 +271,13 @@ jobs: fetch-depth: 0 fetch-tags: true + - name: Download pre-prepared source tree + if: ${{ inputs.srcpkg-artifact != '' }} + uses: actions/download-artifact@v8 + with: + name: ${{ inputs.srcpkg-artifact }} + path: srcpkg + - name: Prepare release if: ${{ inputs.release }} env: @@ -354,13 +373,20 @@ jobs: lib - name: Checkout Repository - if: ${{ needs.resolve.outputs.family == 'debian' && needs.resolve.outputs.force_docker_build != 'true' }} + if: ${{ needs.resolve.outputs.family == 'debian' && needs.resolve.outputs.force_docker_build != 'true' && inputs.srcpkg-artifact == '' }} uses: actions/checkout@v5 with: ref: ${{ inputs.debian-ref }} path: srcpkg fetch-depth: 1 + - name: Download pre-prepared source tree + if: ${{ needs.resolve.outputs.family == 'debian' && inputs.srcpkg-artifact != '' }} + uses: actions/download-artifact@v8 + with: + name: ${{ inputs.srcpkg-artifact }} + path: srcpkg + - name: Validate installability from Debusine CI workspace if: ${{ needs.resolve.outputs.family == 'debian' && needs.resolve.outputs.force_docker_build != 'true' }} env: From 1ea3d9beb5c9d3922c1208786d776f4a4236733d Mon Sep 17 00:00:00 2001 From: Bjordis Collaku Date: Mon, 18 May 2026 19:08:49 -0700 Subject: [PATCH 2/4] Tar-extract srcpkg-artifact to restore exec bits When srcpkg-artifact is set, the artifact is a tar.gz archive rather than a flat directory. Callers that need to preserve Unix file permissions (execute bits on kernel build scripts) must use tar instead of the zip-based artifact upload. Replace the direct download-to-srcpkg/ approach with a two-step download-then-extract pattern: download the artifact to a staging directory, then extract with --strip-components=1 directly into srcpkg/. This is robust regardless of the top-level directory name inside the archive and correctly restores execute permissions that would otherwise be stripped by zip-based artifact transport. Signed-off-by: Bjordis Collaku --- .../qcom-build-pkg-reusable-workflow.yml | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qcom-build-pkg-reusable-workflow.yml b/.github/workflows/qcom-build-pkg-reusable-workflow.yml index 4efd46f..036da47 100644 --- a/.github/workflows/qcom-build-pkg-reusable-workflow.yml +++ b/.github/workflows/qcom-build-pkg-reusable-workflow.yml @@ -276,7 +276,19 @@ jobs: uses: actions/download-artifact@v8 with: name: ${{ inputs.srcpkg-artifact }} - path: srcpkg + path: /tmp/srcpkg-artifact + + - name: Extract pre-prepared source tree + if: ${{ inputs.srcpkg-artifact != '' }} + run: | + # The artifact is a tar.gz archive created by the caller to preserve + # Unix execute permissions on kernel build scripts. zip format (used + # by actions/upload-artifact) strips execute bits; tar does not. + # --strip-components=1 extracts the top-level directory directly into + # srcpkg/ without depending on its name inside the archive. + mkdir srcpkg + tar xzf /tmp/srcpkg-artifact/kernel-srcpkg.tar.gz \ + -C srcpkg --strip-components=1 - name: Prepare release if: ${{ inputs.release }} @@ -385,7 +397,14 @@ jobs: uses: actions/download-artifact@v8 with: name: ${{ inputs.srcpkg-artifact }} - path: srcpkg + path: /tmp/srcpkg-artifact + + - name: Extract pre-prepared source tree + if: ${{ needs.resolve.outputs.family == 'debian' && inputs.srcpkg-artifact != '' }} + run: | + mkdir srcpkg + tar xzf /tmp/srcpkg-artifact/kernel-srcpkg.tar.gz \ + -C srcpkg --strip-components=1 - name: Validate installability from Debusine CI workspace if: ${{ needs.resolve.outputs.family == 'debian' && needs.resolve.outputs.force_docker_build != 'true' }} From 14ff1d1b67c0e087aac5c970ab30af2d919ee5dc Mon Sep 17 00:00:00 2001 From: Bjordis Collaku Date: Thu, 21 May 2026 15:02:30 -0700 Subject: [PATCH 3/4] Add assemble-orig for non-gbp source packaging Add a boolean input assemble-orig (default: false) that, when set, passes DEBUSINE_ASSEMBLE_ORIG=true to generate-source-package. This enables callers whose source tree is assembled externally with no upstream tarball available via gbp or pristine-tar to request direct orig tarball assembly without relying on heuristics inside generate-source-package. Signed-off-by: Bjordis Collaku --- .github/workflows/qcom-build-pkg-reusable-workflow.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/qcom-build-pkg-reusable-workflow.yml b/.github/workflows/qcom-build-pkg-reusable-workflow.yml index 036da47..052d900 100644 --- a/.github/workflows/qcom-build-pkg-reusable-workflow.yml +++ b/.github/workflows/qcom-build-pkg-reusable-workflow.yml @@ -74,6 +74,15 @@ on: type: string default: "" + assemble-orig: + description: | + When true, generate-source-package creates the .orig.tar.gz directly + from the source tree and invokes dpkg-buildpackage -S, bypassing gbp. + Use for packages whose source tree is assembled at CI time with no + upstream tarball available via gbp or pristine-tar. + type: boolean + default: false + secrets: DEBUSINE_USER: required: false @@ -304,6 +313,7 @@ jobs: id: generate-source-package env: SUITE_INPUT: ${{ needs.resolve.outputs.target_suite }} + DEBUSINE_ASSEMBLE_ORIG: ${{ inputs.assemble-orig }} run: | set -ex SUITE="$SUITE_INPUT" debusine-action/lib/generate-source-package From 039d7066bf250352aaab73a5f04c5c5f480533d3 Mon Sep 17 00:00:00 2001 From: Bjordis Collaku Date: Sat, 30 May 2026 23:40:43 -0700 Subject: [PATCH 4/4] ci: decouple extract from caller's tarball name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both "Extract pre-prepared source tree" steps (debian-build and test jobs) hardcoded kernel-srcpkg.tar.gz when unpacking the downloaded artifact. This coupled a general-purpose reusable workflow to a single caller's naming, even though srcpkg-artifact is already a configurable artifact name — any other producer would download successfully and then fail at extraction. Unpack via a *.tar.gz glob so extraction no longer depends on the inner filename. The srcpkg-artifact contract specifies exactly one tarball per artifact, so the glob resolves unambiguously. No change for the current caller (pkg-linux-qcom), which uploads kernel-srcpkg.tar.gz; behavior is identical and the coupling is removed. Signed-off-by: Bjordis Collaku --- .github/workflows/qcom-build-pkg-reusable-workflow.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qcom-build-pkg-reusable-workflow.yml b/.github/workflows/qcom-build-pkg-reusable-workflow.yml index 052d900..8829f21 100644 --- a/.github/workflows/qcom-build-pkg-reusable-workflow.yml +++ b/.github/workflows/qcom-build-pkg-reusable-workflow.yml @@ -295,8 +295,10 @@ jobs: # by actions/upload-artifact) strips execute bits; tar does not. # --strip-components=1 extracts the top-level directory directly into # srcpkg/ without depending on its name inside the archive. + # The artifact contains exactly one *.tar.gz, so the glob below stays + # unambiguous while decoupling this step from the producer's filename. mkdir srcpkg - tar xzf /tmp/srcpkg-artifact/kernel-srcpkg.tar.gz \ + tar xzf /tmp/srcpkg-artifact/*.tar.gz \ -C srcpkg --strip-components=1 - name: Prepare release @@ -412,8 +414,10 @@ jobs: - name: Extract pre-prepared source tree if: ${{ needs.resolve.outputs.family == 'debian' && inputs.srcpkg-artifact != '' }} run: | + # Single *.tar.gz in the artifact; glob decouples from the + # producer's filename (see build-job extract step for rationale). mkdir srcpkg - tar xzf /tmp/srcpkg-artifact/kernel-srcpkg.tar.gz \ + tar xzf /tmp/srcpkg-artifact/*.tar.gz \ -C srcpkg --strip-components=1 - name: Validate installability from Debusine CI workspace