From 96484078503ad39418cbb881400384a5adf4fb01 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 28 May 2024 21:23:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=F0=9F=A7=AA=20Fix=20referencing=20?= =?UTF-8?q?GHA=20artifact=20@=20whl=20builders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It wasn't obvious right away, but referencing a job in the `${{ needs }}` context that is not being depended on, and does not even exist, silently returned an empty string for the whole expression passed to the `name:` input of the `download-artifact` action invocations. This subsequently triggered the behavior of said action to change to "download all the artifacts that exist in the workflow". This "download all" behavior has an additional quirk, though — it downloads each artifact in a subdirectory named after the artifact name. The behavior of the "download one specific artifact" mode, on the other hand, is different in that it does not create an extra level of nesting. This was the reason why it felt necessary to unpack two-levels deep sdist tarballs in the first place. With this patch, references to said sdists will change. --- .github/workflows/ci.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75c62731..e512c32a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,6 +29,8 @@ env: jobs: python_sdist: runs-on: ubuntu-22.04 + outputs: + artifact_name: ${{ steps.build_sdist.outputs.artifact_name }} steps: - name: clone repo uses: actions/checkout@v4 @@ -258,7 +260,7 @@ jobs: id: fetch_sdist uses: actions/download-artifact@v4 with: - name: ${{ needs.build_sdist.outputs.artifact_name }} + name: ${{ needs.python_sdist.outputs.artifact_name }} - name: configure docker foreign arch support uses: docker/setup-qemu-action@v3 @@ -386,7 +388,7 @@ jobs: id: fetch_sdist uses: actions/download-artifact@v4 with: - name: ${{ needs.build_sdist.outputs.artifact_name }} + name: ${{ needs.python_sdist.outputs.artifact_name }} - name: install python uses: actions/setup-python@v5 @@ -488,7 +490,7 @@ jobs: id: fetch_sdist uses: actions/download-artifact@v4 with: - name: ${{ needs.build_sdist.outputs.artifact_name }} + name: ${{ needs.python_sdist.outputs.artifact_name }} - name: build/test wheels uses: pypa/cibuildwheel@v2.18.1