diff --git a/.github/workflows/qcom-build-pkg-reusable-workflow.yml b/.github/workflows/qcom-build-pkg-reusable-workflow.yml index 00f2e79..8829f21 100644 --- a/.github/workflows/qcom-build-pkg-reusable-workflow.yml +++ b/.github/workflows/qcom-build-pkg-reusable-workflow.yml @@ -64,6 +64,25 @@ 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: "" + + 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 @@ -95,7 +114,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 +272,7 @@ jobs: lib - name: Checkout Repository + if: ${{ inputs.srcpkg-artifact == '' }} uses: actions/checkout@v5 with: ref: ${{ inputs.debian-ref }} @@ -259,6 +280,27 @@ 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: /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. + # 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/*.tar.gz \ + -C srcpkg --strip-components=1 + - name: Prepare release if: ${{ inputs.release }} env: @@ -273,6 +315,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 @@ -354,13 +397,29 @@ 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: /tmp/srcpkg-artifact + + - 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/*.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' }} env: