Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish (for example v0.1.5)'
required: true
type: string

permissions:
contents: read

jobs:
github-release:
name: Package GitHub release
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
Expand Down Expand Up @@ -61,3 +68,44 @@ jobs:
else
gh release create "$GITHUB_REF_NAME" "$VSIX" "$VSIX.sha256" --generate-notes --title "Kimi Code CLI Launcher $GITHUB_REF_NAME" --verify-tag
fi

publish:
name: Publish released VSIX
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-kimi-code-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-kimi-code-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-kimi-code-cli-launcher-${RELEASE_TAG#v}.vsix" \
--trusted-publishing --skip-duplicate
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Use `npm ci --ignore-scripts` for a clean, reproducible install. Do not replace
- Add user-visible changes to the `Unreleased` section of `CHANGELOG.md`.
- For a release, keep versions synchronized in `package.json`, `package-lock.json`, `CITATION.cff`, and `test/metadata.test.js`; keep the real release date synchronized between `CITATION.cff` and `CHANGELOG.md`. `npm version <x.y.z> --no-git-tag-version` is the supported way to update the manifest and the lockfile together.
- A `v<version>` tag triggers the GitHub release workflow. Do not create tags, push, publish, or upload Marketplace packages unless explicitly authorized.
- The extension is published as `mikesoft.vscode-kimi-code-cli-launcher` on the VS Code Marketplace and on Open VSX. Both registries are updated manually by the maintainer with `vsce publish` and `ovsx publish`; the required tokens are deliberately absent from this repository, from the shell environment, and from GitHub Actions secrets, so no workflow or agent can publish. Never add them.
- The extension is published as `mikesoft.vscode-kimi-code-cli-launcher` on the VS Code Marketplace and on Open VSX. Both registries are updated by the owner by manually dispatching the `Release` workflow with an existing release tag; it uses OIDC trusted publishing, so no long-lived registry token is stored in the repository, the shell environment, or GitHub Actions secrets. Never add publishing tokens.
- `main` is protected and requires one approving review. Land changes through a branch and a pull request; never self-approve or bypass the protection.
- Maintain the unofficial-project and trademark disclaimer. Do not imply endorsement by Moonshot AI or Kimi.

Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ For a release:

The `Release` workflow verifies the tag/version match, reruns validation and the security audit, packages the VSIX, creates a SHA-256 checksum, and creates or updates the GitHub release.

VS Code Marketplace and Open VSX publishing are separate manual maintainer steps:
VS Code Marketplace and Open VSX publishing is owner-controlled and uses OIDC trusted publishing. After
the GitHub release exists, dispatch the `Release` workflow with that release tag:

```bash
npx @vscode/vsce publish --packagePath vscode-kimi-code-cli-launcher-<version>.vsix
npx ovsx publish vscode-kimi-code-cli-launcher-<version>.vsix
gh workflow run release.yml -f tag=v<x.y.z>
```

These commands require registry publisher tokens. Tokens are deliberately absent from the repository, local automation, and GitHub Actions.
The publish job downloads the released VSIX, verifies its checksum, and publishes it to both registries
with short-lived OIDC credentials. No registry publisher token is stored in the repository, local
automation, or GitHub Actions secrets.
Loading