From e16eba535c9049320e3ad25b4a237776fe756dda Mon Sep 17 00:00:00 2001 From: DB Lee Date: Thu, 28 May 2026 13:35:36 -0700 Subject: [PATCH] Harden publish-vsix job ahead of rebrand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prepare release.yml so the upcoming agentops-toolkit → agentops-accelerator rename can publish through a single tag-driven release without VSIX/PyPI ordering surprises or silent VSIX publish failures. - publish-vsix now needs [build, publish-pypi] so a failed PyPI no longer leaves a stranded Marketplace artifact pointing at a missing distribution. - Hoist VSIX filename to a job-level env var (VSIX_FILE); the rename now flips one value instead of grepping ~5 places. - Narrow continue-on-error to the 'already exists' idempotency case only. Capture output, grep -i for 'already exists' (verified against vscode-vsce src/publish.ts:231,247), and exit 0 only for that case. Other failures (auth, network, schema) now fail the job. Move VSCE_PAT to step-level env. - Gate github-release on publish-vsix.result == 'success' so a real (non- idempotent) VSIX publish failure no longer produces a GitHub Release that silently lacks the VSIX asset. Refs #181 (PR-1 of 3-PR rebrand strategy). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/release.yml | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45d45ee..fea6166 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -174,11 +174,13 @@ jobs: # ── VSIX Stable Publish ────────────────────────────────────────────── # Publish the VS Code extension as a stable release to the Marketplace. - # Runs in parallel with the TestPyPI→PyPI flow (only needs source checkout). + # Runs after PyPI publish so PyPI and Marketplace identity stay consistent on every release. publish-vsix: - needs: build # gate on successful lint + test + needs: [build, publish-pypi] # gate on successful lint + test (build) and on PyPI publish runs-on: ubuntu-latest environment: release # same approval gate as PyPI + env: + VSIX_FILE: agentops-skills.vsix steps: - uses: actions/checkout@v6 with: @@ -211,23 +213,40 @@ jobs: - name: Package VSIX working-directory: plugins/agentops - run: vsce package -o agentops-skills.vsix + run: vsce package -o "${VSIX_FILE}" - name: Publish stable to VS Code Marketplace - continue-on-error: true # Tolerate "already exists" if staging pre-release published this version + # Tolerate ONLY the "already exists" case (staging pre-release may have + # published the same version first). Any other failure must fail the job. working-directory: plugins/agentops - run: vsce publish --packagePath agentops-skills.vsix -p "${{ secrets.VSCE_PAT }}" + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} + run: | + set -o pipefail + if OUTPUT=$(vsce publish --packagePath "${VSIX_FILE}" -p "${VSCE_PAT}" 2>&1); then + RC=0 + else + RC=$? + fi + echo "$OUTPUT" + if [ "$RC" -ne 0 ]; then + if echo "$OUTPUT" | grep -qi "already exists"; then + echo "::warning::VSIX version already published (likely by staging pre-release). Treating as success." + exit 0 + fi + exit "$RC" + fi - name: Upload VSIX artifact uses: actions/upload-artifact@v7 with: name: vsix - path: plugins/agentops/agentops-skills.vsix + path: plugins/agentops/${{ env.VSIX_FILE }} # Create GitHub Release with built artifacts (Python dist + VSIX) github-release: needs: [publish-pypi, publish-vsix] - if: always() && needs.publish-pypi.result == 'success' + if: always() && needs.publish-pypi.result == 'success' && needs.publish-vsix.result == 'success' runs-on: ubuntu-latest permissions: contents: write