Skip to content

Commit 01b51f4

Browse files
authored
Merge pull request #39 from peelar/feat/release
add release process
2 parents cd3660f + 20fc41b commit 01b51f4

8 files changed

Lines changed: 659 additions & 1 deletion

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
23+
- name: Get pnpm version from package.json
24+
id: pnpm-version
25+
run: |
26+
PNPM_VERSION=$(node -p "require('./package.json').packageManager?.replace('pnpm@', '') || ''")
27+
echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
with:
32+
version: ${{ steps.pnpm-version.outputs.version }}
33+
34+
- name: Get pnpm store directory
35+
shell: bash
36+
run: |
37+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38+
39+
- name: Setup pnpm cache
40+
uses: actions/cache@v4
41+
with:
42+
path: ${{ env.STORE_PATH }}
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-store-
46+
47+
- name: Install dependencies
48+
run: pnpm install --frozen-lockfile
49+
50+
- name: Create or update release PR
51+
uses: changesets/action@v1
52+
with:
53+
version: pnpm changeset:version
54+
publish: pnpm exec echo "publish step skipped"
55+
commit: "chore: release"
56+
title: "chore: release"
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dopeshot is the visual identity toolkit for indie hackers and small builders. As
1919
- Keep the Design sidebar for styling; look/variant switching stays in the rail/toggle above the canvas.
2020
- Be very hesitant about adding something new to the sidebar. It should be as intelligent as possible, with no extra clicks or steps.
2121
- Actively look for ways to refactor crucial parts of the codebase.
22+
- Add a Changeset for any user-facing change or code change that should appear in the changelog; use `pnpm changeset` and commit the generated file.
2223
- After you are done with implementation, verify if the types & tests work via scripts in `package.json`.
2324
- Whenever you have "a bigger fix" in mind or a refactor, go for it. We are building for tomorrow, not today.
2425
- **Always add tracking events** for all new user-facing functionalities using `track()` from `@/lib/analytics`. Track user interactions, state changes, and feature usage with descriptive event names and relevant properties (e.g., `track("feature_used", { property: value })`).

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Ideas? Bugs? [Open an issue](https://github.com/yourusername/dopeshot/issues).
5555

5656
Want to add a look or typography preset? Check out the [authoring guide](./AUTHORING.md).
5757

58+
All PRs should include a Changeset (`pnpm changeset`) describing user-facing changes; see [docs/RELEASE_WORKFLOW.md](./docs/RELEASE_WORKFLOW.md) for the flow.
59+
5860
---
5961

6062
Built by indie hackers, for indie hackers. Ship fast, post faster.

docs/RELEASE_WORKFLOW.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Release workflow (changesets)
2+
3+
This repo uses [Changesets](https://github.com/changesets/changesets) to track human-written change notes and create release PRs. Nothing is published to npm.
4+
5+
## Daily flow
6+
7+
1. Add a changeset in each PR that should be part of the next release:
8+
- `pnpm changeset` → choose the package (just `dopeshot`) and version bump type (usually `patch`).
9+
- Write a short, user-facing summary. Keep it to one bullet per change.
10+
- Commit the generated file under `.changeset/`.
11+
2. Merge PRs as usual. The release workflow will stack all pending changesets on `main`.
12+
3. Wait for the Release workflow to open a PR titled `chore: release`. That PR contains:
13+
- Version bump in `package.json`.
14+
- Updated `CHANGELOG.md`.
15+
- Updated lockfile.
16+
- CI on that PR uses the existing `Test` workflow.
17+
4. Merge the `chore: release` PR when green. That finalizes the release (no publish step runs).
18+
19+
## Local commands
20+
21+
- See pending changesets: `pnpm changeset:status`
22+
- Bump versions and regenerate changelog locally (mirrors the GitHub Action): `pnpm release`
23+
- Just run the version step (no tests): `pnpm changeset:version`
24+
- Start a new changeset: `pnpm changeset`
25+
26+
## CI details
27+
28+
- `.github/workflows/release.yml` watches `main` and `workflow_dispatch`.
29+
- It installs dependencies, runs `changesets/action@v1` to open/update the release PR, and skips publishing via a no-op command.
30+
- The existing `.github/workflows/test.yml` runs on PRs (including the release PR) to execute lint/typecheck/unit/e2e tests. Merge only when green.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"build": "next build",
99
"start": "next start",
1010
"lint": "eslint",
11+
"changeset": "changeset",
12+
"changeset:status": "pnpm changeset status --verbose",
13+
"changeset:version": "pnpm changeset version && pnpm install --no-frozen-lockfile",
1114
"knip": "knip",
1215
"typecheck": "tsc --noEmit",
1316
"test:domain": "tsx tests/color-extraction.test.ts && tsx tests/gradient-generation.test.ts",
@@ -16,7 +19,8 @@
1619
"test:e2e:install": "playwright install --with-deps chromium",
1720
"test": "pnpm test:domain && pnpm test:ui && pnpm test:e2e",
1821
"test:ci": "pnpm typecheck && pnpm test:domain && pnpm test:ui && pnpm test:e2e",
19-
"check": "pnpm lint && pnpm typecheck && pnpm test:domain && pnpm test:ui && pnpm test:e2e"
22+
"check": "pnpm lint && pnpm typecheck && pnpm test:domain && pnpm test:ui && pnpm test:e2e",
23+
"release": "pnpm changeset:version && pnpm check"
2024
},
2125
"pnpm": {
2226
"onlyBuiltDependencies": [
@@ -61,6 +65,7 @@
6165
"tailwind-merge": "^2.5.3"
6266
},
6367
"devDependencies": {
68+
"@changesets/cli": "^2.29.8",
6469
"@playwright/test": "^1.57.0",
6570
"@testing-library/dom": "^10.4.1",
6671
"@testing-library/jest-dom": "^6.9.1",

0 commit comments

Comments
 (0)