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 <noreply@anthropic.com>
This commit is contained in:
DevContainer User
2026-03-04 01:48:20 +00:00
parent 707a19ad9b
commit 27b5991a63
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -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: |
+1 -1
View File
@@ -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"