From ebe4411a50423a5f7f00f5f6b571ab22933f3c10 Mon Sep 17 00:00:00 2001 From: marius-kilocode Date: Thu, 29 Jan 2026 22:31:14 +0100 Subject: [PATCH] feat: add changeset-based release notes mechanism --- .changeset/README.md | 21 +++++++++++++ .changeset/config.json | 11 +++++++ .github/workflows/changeset-release.yml | 39 +++++++++++++++++++++++++ .github/workflows/publish.yml | 13 +++++++-- package.json | 6 +++- 5 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .github/workflows/changeset-release.yml diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 000000000..e1f1ffa47 --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,21 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in the changesets repo](https://github.com/changesets/changesets). + +## Adding a changeset + +To add a changeset, run `bun run changeset` in the root of the repository. This will prompt you to: + +1. Select which packages should be updated +2. Choose the version bump type (major, minor, or patch) +3. Write a summary of the changes + +The changeset file will be created in this directory and should be committed with your PR. + +## How it works + +1. When you create a PR with code changes, include a changeset describing the change +2. When PRs are merged to `dev`, the changeset-release workflow will create or update a "Version Bump" PR +3. When the Version Bump PR is merged, it will trigger a release with the generated changelog diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 000000000..490c0b94e --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json", + "changelog": ["@changesets/changelog-github", { "repo": "Kilo-Org/kilo" }], + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "dev", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/changeset-release.yml b/.github/workflows/changeset-release.yml new file mode 100644 index 000000000..10d1a8d66 --- /dev/null +++ b/.github/workflows/changeset-release.yml @@ -0,0 +1,39 @@ +# kilocode_change - new file +name: Changeset Release + +on: + push: + branches: + - dev + workflow_dispatch: + +jobs: + changeset-pr-version-bump: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Git Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: dev + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install Dependencies + run: bun install + + - name: Changeset Pull Request + id: changesets + uses: changesets/action@v1 + with: + commit: "changeset version bump" + title: "Changeset version bump" + version: bun run changeset:version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c4fca8054..3dc4ebcf0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,10 @@ name: publish run-name: "${{ format('release {0}', inputs.bump) }}" on: + # kilocode_change start - trigger on changeset PR merge + pull_request: + types: [closed] + # kilocode_change end push: branches: - dev @@ -31,8 +35,13 @@ permissions: jobs: publish: runs-on: depot-ubuntu-24.04-4 - # kilocode_change start - disabled for kilo-cli fork (OpenCode npm/AUR publishing) - if: false + # kilocode_change start - trigger on changeset PR merge or workflow_dispatch + if: > + ( github.event_name == 'pull_request' && + github.event.pull_request.merged == true && + github.event.pull_request.base.ref == 'dev' && + contains(github.event.pull_request.title, 'Changeset version bump') ) || + github.event_name == 'workflow_dispatch' # kilocode_change end - original: if: github.repository == 'Kilo-Org/kilo' steps: - uses: actions/checkout@v3 diff --git a/package.json b/package.json index ee4b43b00..9f66607ca 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "prepare": "husky", "random": "echo 'Random script'", "hello": "echo 'Hello World!'", - "test": "echo 'do not run tests from root' && exit 1" + "test": "echo 'do not run tests from root' && exit 1", + "changeset": "changeset", + "changeset:version": "changeset version" }, "workspaces": { "packages": [ @@ -64,6 +66,8 @@ }, "devDependencies": { "@actions/artifact": "5.0.1", + "@changesets/changelog-github": "^0.5.1", + "@changesets/cli": "^2.27.10", "@tsconfig/bun": "catalog:", "baseline-browser-mapping": "2.9.18", "husky": "9.1.7",