Skip to content
Draft
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
21 changes: 21 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -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": []
}
39 changes: 39 additions & 0 deletions .github/workflows/changeset-release.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Non-deterministic Bun version (latest) can break the release workflow

Using bun-version: latest can introduce unexpected CI breakages when Bun releases. Pin to the repo's declared Bun version (e.g. the packageManager version) to keep releases reproducible.


- 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 }}
13 changes: 11 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Workflow triggers on push but the job is gated to PR-merge events

With the current job if, pushes to dev/snapshot-* will still start the workflow but skip jobs.publish. Consider either removing the push trigger (if releases should only come from the changeset bump PR) or expanding the job if to include the desired push cases to avoid no-op runs.

branches:
- dev
Expand Down Expand Up @@ -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') ) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Release trigger relies only on PR title substring

contains(github.event.pull_request.title, 'Changeset version bump') is fairly permissive; any merged PR to dev with that phrase in the title would satisfy this condition. To reduce accidental/undesired releases, consider also checking something that uniquely identifies the changesets bot PR (e.g. github.event.pull_request.user.login == 'github-actions[bot]' and/or matching head.ref, labels, or an expected PR branch naming convention).

github.event_name == 'workflow_dispatch'
# kilocode_change end - original: if: github.repository == 'Kilo-Org/kilo'
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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",
Expand Down
Loading