fix: correct archive checksum and automate CI updates (#1)
## Summary - Fix the v0.0.1 archive checksum in `artifacthub-pkg.yml` to match the actual GitHub release tarball (was causing "Checksum mismatch" on Headlamp plugin install) - Gitea CI now computes the checksum after packaging and updates `artifacthub-pkg.yml` on `main` via the Gitea API, then uploads the **same tarball** to GitHub releases (requires `GH_PAT` secret) so both releases serve identical artifacts - GitHub CI becomes a fallback — skips entirely if the Gitea CI already created the release, preventing a second build from producing a mismatched tarball ## Setup required Add a `GH_PAT` secret to the Gitea repo containing a GitHub personal access token with `repo` scope. Without it, the GitHub release step gracefully skips and the GitHub Actions fallback handles it. ## Test plan - [ ] Verify `GH_PAT` secret is set in Gitea repo settings - [ ] Tag and push a new release (`v0.0.2`) - [ ] Confirm Gitea CI updates `artifacthub-pkg.yml` checksum on `main` - [ ] Confirm GitHub release is created by Gitea CI with matching tarball - [ ] Confirm GitHub Actions fallback skips (release already exists) - [ ] Verify Headlamp plugin installs without checksum mismatch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Chris Farhood <chris@farhood.org> Reviewed-on: farhoodliquor/polaris-headlamp-plugin#1 Co-authored-by: claude <no-reply.claude@farh.net> Co-committed-by: claude <no-reply.claude@farh.net>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: GitHub Release
|
||||
name: GitHub Release (fallback)
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -12,25 +12,44 @@ jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if release already exists
|
||||
id: check
|
||||
run: |
|
||||
if gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" &>/dev/null; then
|
||||
echo "Release ${{ github.ref_name }} already exists (created by Gitea CI), skipping."
|
||||
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "No existing release found, building as fallback."
|
||||
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Checkout
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
run: npm ci
|
||||
|
||||
- name: Build plugin
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
run: npx @kinvolk/headlamp-plugin build
|
||||
|
||||
- name: Package tarball
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
run: npx @kinvolk/headlamp-plugin package
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: "*.tar.gz"
|
||||
|
||||
Reference in New Issue
Block a user