feat(kernel): Upload package tree instead of pre-zipped artifact
All checks were successful
Build kernel module / build (1:6.12.93-1+rpt1, bookworm) (pull_request) Successful in 49s
Build kernel module / build (1:6.18.34-1+rpt1, trixie) (pull_request) Successful in 54s
Build kernel module / package (pull_request) Successful in 23s
Build kernel module / release (pull_request) Has been skipped

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.
This commit is contained in:
Christian Werner 2026-06-20 05:42:55 +02:00
parent a5406f503c
commit 27ff299f43

View File

@ -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/<repo>/ -> <repo>/...
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/<repo>/...
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