diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7879f77..521f6d3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,12 +47,13 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" - name: Update version in package.json - run: npm version ${{ inputs.version }} --no-git-tag-version + run: npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version - name: Update artifacthub-pkg.yml run: | VERSION="${{ inputs.version }}" - RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/headlamp-rook-plugin-${VERSION}.tar.gz" + PKG_NAME=$(jq -r .name package.json) + RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${PKG_NAME}-${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 @@ -68,12 +69,15 @@ jobs: - name: Prepare release tarball run: | VERSION="${{ inputs.version }}" - TARBALL="headlamp-rook-plugin-${VERSION}.tar.gz" - GENERATED=$(ls *.tar.gz) - if [ "$GENERATED" != "$TARBALL" ]; then - mv "$GENERATED" "$TARBALL" + PKG_NAME=$(jq -r .name package.json) + TARBALL="${PKG_NAME}-${VERSION}.tar.gz" + if [ ! -f "$TARBALL" ]; then + echo "Error: Expected tarball $TARBALL not found" + ls -la *.tar.gz 2>/dev/null || echo "No .tar.gz files found" + exit 1 fi echo "TARBALL=$TARBALL" >> $GITHUB_ENV + echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV - name: Validate tarball run: |