From 27b5991a63e92d7aaefa49a28c7436beef58c21c Mon Sep 17 00:00:00 2001 From: DevContainer User Date: Wed, 4 Mar 2026 01:48:20 +0000 Subject: [PATCH] fix: hardcode tarball name in release workflow The dynamic PKG_NAME read from package.json returns "rook", causing `mv rook-X.Y.Z.tar.gz rook-X.Y.Z.tar.gz` to fail as a self-rename. Hardcode "headlamp-rook-plugin" as the tarball name to match the repo and artifacthub expectations. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yaml | 12 ++++++------ artifacthub-pkg.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index db8db0a..709a839 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -52,8 +52,7 @@ jobs: - name: Update artifacthub-pkg.yml run: | VERSION="${{ inputs.version }}" - PKG_NAME=$(jq -r .name package.json) - RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${PKG_NAME}-${VERSION}.tar.gz" + RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/headlamp-rook-plugin-${VERSION}.tar.gz" sed -i "s/^version:.*/version: \"${VERSION}\"/" artifacthub-pkg.yml sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"${RELEASE_URL}\"|" artifacthub-pkg.yml @@ -69,11 +68,12 @@ jobs: - name: Prepare release tarball run: | VERSION="${{ inputs.version }}" - PKG_NAME=$(jq -r .name package.json) - TARBALL="${PKG_NAME}-${VERSION}.tar.gz" - mv *.tar.gz "$TARBALL" + TARBALL="headlamp-rook-plugin-${VERSION}.tar.gz" + GENERATED=$(ls *.tar.gz) + if [ "$GENERATED" != "$TARBALL" ]; then + mv "$GENERATED" "$TARBALL" + fi echo "TARBALL=$TARBALL" >> $GITHUB_ENV - echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV - name: Validate tarball run: | diff --git a/artifacthub-pkg.yml b/artifacthub-pkg.yml index 340db1c..be19a4a 100644 --- a/artifacthub-pkg.yml +++ b/artifacthub-pkg.yml @@ -27,7 +27,7 @@ changes: description: "Package renamed to rook so the plugin displays correctly in Headlamp's Plugins list" annotations: - headlamp/plugin/archive-url: "https://github.com/privilegedescalation/headlamp-rook-plugin/releases/download/v0.2.2/rook-0.2.2.tar.gz" + headlamp/plugin/archive-url: "https://github.com/privilegedescalation/headlamp-rook-plugin/releases/download/v0.2.2/headlamp-rook-plugin-0.2.2.tar.gz" headlamp/plugin/archive-checksum: "sha256:0c0d39f275f206cd0fe66a17f98c9bf0b9a5d74122bad770c7d4051e59f85675" headlamp/plugin/distro-compat: "" headlamp/plugin/version-compat: ">=0.20"