From 27ff299f43e24fde293af5dd65f8ae8ec3ad9e32 Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Sat, 20 Jun 2026 05:42:55 +0200 Subject: [PATCH] feat(kernel): Upload package tree instead of pre-zipped artifact Switch to uploading the assembled package directory as the artifact, allowing the platform to encapsulate it in a single-layer zip. This avoids nested zips and ensures the release process reuses the same archive structure for consistency. --- .gitea/workflows/build-kernel.yml | 39 ++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/build-kernel.yml b/.gitea/workflows/build-kernel.yml index 83224ac..de478e9 100644 --- a/.gitea/workflows/build-kernel.yml +++ b/.gitea/workflows/build-kernel.yml @@ -101,10 +101,15 @@ jobs: # Merge all built modules into one modules/ folder, wrap it in a single # repo-named top folder alongside the helper scripts (selftest.sh, launch.sh) - # and the iecpoc Python frontend (so launch.sh can pip-install it on the Pi), - # and zip it. Runs on BOTH triggers and uploads the zip as an artifact: on a PR - # this lets you download and smoke-test the exact archive a release would ship; - # on a tag the release job below republishes this same artifact unchanged. + # and the iecpoc Python frontend (so launch.sh can pip-install it on the Pi). + # Runs on BOTH triggers and uploads the assembled FOLDER as an artifact: on a PR + # this lets you download and smoke-test the exact tree a release would ship; on a + # tag the release job below zips this same tree and attaches it. + # + # We intentionally upload the folder, not a pre-made .zip: artifacts are always + # transported as a zip by the platform, so uploading a .zip would nest one zip + # inside another. Uploading the tree makes the platform's wrapper zip *be* the + # package archive (a single, clean layer). package: needs: build runs-on: ubuntu-latest @@ -129,7 +134,7 @@ jobs: esac echo "ver=$v" >> "$GITHUB_OUTPUT" - - name: Assemble package zip + - name: Assemble package tree run: | repo="${{ github.event.repository.name }}" root="package/$repo" @@ -143,32 +148,40 @@ jobs: cp pyproject.toml README.md "$root"/ cp -r iecpoc "$root"/ find "$root/iecpoc" -name __pycache__ -type d -prune -exec rm -rf {} + - (cd package && zip -r "../${repo}-${{ steps.ver.outputs.ver }}.zip" "$repo") - - name: Upload package zip + - name: Upload package uses: https://github.com/christopherHX/gitea-upload-artifact@v4 with: name: ${{ github.event.repository.name }}-${{ steps.ver.outputs.ver }} - path: ${{ github.event.repository.name }}-*.zip + # Upload the contents of package/, so the artifact zip contains the + # single top folder package// -> /... + path: package if-no-files-found: error - # Release flow only: takes the zip the package job already built and attaches it - # to the Gitea release for the pushed tag. No re-assembly here. Skipped on PRs. + # Release flow only: download the assembled tree the package job uploaded, zip it + # into the named release asset and attach it to the Gitea release for the pushed + # tag. No re-assembly here (the tree is taken as-is). Skipped on PRs. release: needs: package if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - - name: Download package zip + - name: Download package uses: https://github.com/christopherHX/gitea-download-artifact@v4 with: - # The single artifact the package job produced for this tag. + # The single artifact the package job produced for this tag; extracts to + # dist//... name: ${{ github.event.repository.name }}-${{ github.ref_name }} path: dist + - name: Zip release asset + run: | + repo="${{ github.event.repository.name }}" + (cd dist && zip -r "../${repo}-${{ github.ref_name }}.zip" "$repo") + - name: Publish to Gitea release uses: https://gitea.com/actions/gitea-release-action@v1.3.6 with: api_key: ${{ secrets.GITEA_TOKEN }} files: |- - dist/*.zip + ${{ github.event.repository.name }}-${{ github.ref_name }}.zip