From fa8203aa9be232b1be4418f0756fe43811a7d650 Mon Sep 17 00:00:00 2001 From: "hugh-hackman[bot]" Date: Sun, 8 Mar 2026 00:46:22 +0000 Subject: [PATCH] ci: switch to org-level reusable workflows --- .github/workflows/ci.yaml | 31 +----------- .github/workflows/release.yaml | 92 ++-------------------------------- 2 files changed, 4 insertions(+), 119 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cfc2606..3a7f700 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,33 +9,4 @@ on: jobs: ci: - runs-on: local-ubuntu-latest - timeout-minutes: 10 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Build plugin - run: npx @kinvolk/headlamp-plugin build - - - name: Lint - run: npm run lint - - - name: Type-check - run: npm run tsc - - - name: Format check - run: npm run format:check - - - name: Run tests - run: npm test + uses: privilegedescalation/.github/.github/workflows/plugin-ci.yaml@main diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4a050a8..010e801 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,94 +11,8 @@ on: permissions: contents: write -concurrency: - group: release - cancel-in-progress: false - jobs: - ci: - uses: ./.github/workflows/ci.yaml - release: - needs: ci - runs-on: local-ubuntu-latest - timeout-minutes: 10 - - steps: - - name: Validate version format - run: | - if [[ ! "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: Version must be in X.Y.Z format" - exit 1 - fi - - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - 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 --allow-same-version - - - 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" - 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 - - - name: Install dependencies - run: npm ci - - - name: Build plugin - run: npx @kinvolk/headlamp-plugin build - - - name: Package plugin - run: npx @kinvolk/headlamp-plugin package - - - name: Prepare release tarball - run: | - VERSION="${{ inputs.version }}" - PKG_NAME=$(jq -r .name package.json) - TARBALL="${PKG_NAME}-${VERSION}.tar.gz" - echo "TARBALL=$TARBALL" >> $GITHUB_ENV - echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV - - - name: Validate tarball - run: | - echo "Tarball: ${{ env.TARBALL }}" - ls -lh "${{ env.TARBALL }}" - tar -tzf "${{ env.TARBALL }}" | head -20 - tar -tzf "${{ env.TARBALL }}" | grep -q "main.js" || { echo "Error: main.js not found in tarball"; exit 1; } - - - name: Compute checksum - run: | - CHECKSUM=$(sha256sum "${{ env.TARBALL }}" | awk '{print $1}') - echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV - sed -i "s|headlamp/plugin/archive-checksum:.*|headlamp/plugin/archive-checksum: sha256:${CHECKSUM}|" artifacthub-pkg.yml - - - name: Commit and tag - run: | - VERSION="${{ inputs.version }}" - git add package.json package-lock.json artifacthub-pkg.yml - git commit -m "release: v${VERSION}" - git tag "v${VERSION}" - git push origin main --tags - - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - tag_name: v${{ inputs.version }} - name: v${{ inputs.version }} - generate_release_notes: true - files: ${{ env.TARBALL }} + uses: privilegedescalation/.github/.github/workflows/plugin-release.yaml@main + with: + version: ${{ inputs.version }} -- 2.52.0