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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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 our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
93 changes: 58 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,75 @@
name: CI
name: CI & Release

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
push:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
build-test-release:
name: Build, Test & Release
runs-on: ubuntu-latest

permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
steps:
- uses: actions/checkout@v4
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install
- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm build

- name: Build
run: pnpm run build
- name: Type Check
run: pnpm run typecheck

- name: Type Check
run: pnpm run typecheck
- name: Lint
run: pnpm run lint

- name: Lint
run: pnpm run lint
- name: Test
run: pnpm run test

- name: Test
run: pnpm run test
- name: Create Release Pull Request or Publish to npm
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
commit: "chore: version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44 changes: 44 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Release Process

This repository uses [Changesets](https://github.com/changesets/changesets) to manage versions, create changelogs, and publish to npm.

## Workflow

1. Make changes
2. Add a changeset using `pnpm changeset`
3. Commit and push
4. Create a PR
5. When the PR is merged, a "Version Packages" PR will be automatically created
6. When the "Version Packages" PR is merged, packages will be published to npm automatically

## Creating a changeset

To create a changeset, run:

```bash
pnpm changeset
```

This will:
1. Ask which packages you want to release
2. Ask what type of version change it is (major, minor, patch)
3. Ask for a summary of the changes

This will create a markdown file in the `.changeset` directory that should be committed with your changes.

## CI & Release Process

The CI/Release process is streamlined into a single workflow:

1. All PRs and main branch commits trigger the CI process (build, type check, lint, test)
2. When changes are merged to the main branch, the same workflow also:
- Creates or updates a "Version Packages" PR that includes version bumps and changelog updates
- When the Version Packages PR is merged, automatically publishes packages to npm

## Manual release

If you need to do a manual release:

1. Run `pnpm changeset version` to update versions and changelogs
2. Run `pnpm build` to build all packages
3. Run `pnpm changeset publish` to publish to npm
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
"test": "pnpm -r test",
"lint": "pnpm -r lint",
"typecheck": "pnpm -r typecheck",
"bench": "pnpm --filter d2ts-benchmark bench"
"bench": "pnpm --filter d2ts-benchmark bench",
"changeset": "changeset",
"version": "changeset version",
"release": "changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.28.1",
"@electric-sql/d2ts": "workspace:*",
"@eslint/js": "latest",
"@types/node": "^22.10.2",
Expand Down
Loading