From 1464fc33bca483a4c50dab7278d974fce793d630 Mon Sep 17 00:00:00 2001 From: Michael Gasperini Date: Sun, 1 Nov 2026 00:36:48 +0100 Subject: [PATCH] ci: publish releases through trusted publishing --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ AGENTS.md | 15 +++++------ 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c757cde..540d4d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,12 +4,19 @@ on: push: tags: - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'Release tag to publish (for example v0.1.11)' + required: true + type: string permissions: contents: write jobs: github-release: + if: github.event_name == 'push' runs-on: ubuntu-latest timeout-minutes: 20 @@ -47,3 +54,43 @@ jobs: --title "Antigravity CLI Launcher $GITHUB_REF_NAME" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish: + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + id-token: write + + steps: + - name: Download the released VSIX + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ inputs.tag }} + run: | + set -euo pipefail + VSIX="vscode-antigravity-cli-launcher-${RELEASE_TAG#v}.vsix" + mkdir -p .release + gh release download "$RELEASE_TAG" \ + --repo "$GITHUB_REPOSITORY" \ + --pattern "$VSIX" \ + --pattern "$VSIX.sha256" \ + --dir .release + (cd .release && sha256sum -c "$VSIX.sha256") + + - name: Publish to Visual Studio Marketplace + env: + RELEASE_TAG: ${{ inputs.tag }} + run: | + npx --yes @vscode/vsce@4.1.0 publish \ + --packagePath ".release/vscode-antigravity-cli-launcher-${RELEASE_TAG#v}.vsix" \ + --oidc --skip-duplicate + + - name: Publish to Open VSX + env: + RELEASE_TAG: ${{ inputs.tag }} + run: | + npx --yes ovsx@1.3.0 publish \ + --packagePath ".release/vscode-antigravity-cli-launcher-${RELEASE_TAG#v}.vsix" \ + --trusted-publishing --skip-duplicate diff --git a/AGENTS.md b/AGENTS.md index 2cabd72..f564195 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -168,15 +168,12 @@ For an authorized release: digest and all CI/CodeQL checks. Visual Studio Marketplace and Open VSX publication is performed by the repository -owner. Do not attempt or claim those publications unless the owner explicitly -delegates them. Read-only verification of the public versions and checksums is -allowed when relevant. - -Publishing requires credentials that are not stored in this repository and are -not configured as GitHub Actions secrets. `vsce publish` needs an Azure DevOps -personal access token for the `mikesoft` publisher (`VSCE_PAT` or `vsce login`), -and `ovsx publish` needs an Open VSX access token (`OVSX_PAT`). Never write these -values into files, logs, commits, or summaries. +owner. After the GitHub Release exists, dispatch the Release workflow with that +tag: it publishes the released VSIX through OIDC trusted publishing, so no +registry token is stored in the repository or in GitHub Actions secrets. Do not +attempt or claim those publications unless the owner dispatches the workflow. +Read-only verification of the public versions and checksums is allowed when +relevant. ## Git And Handoff