Skip to content

Commit 593cda1

Browse files
committed
chore: add @changesets/changelog-github for better changelogs
1 parent 1401cc8 commit 593cda1

4 files changed

Lines changed: 116 additions & 61 deletions

File tree

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3-
"changelog": "@changesets/cli/changelog",
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "tkhq/sdk" }],
44
"commit": false,
55
"linked": [],
66
"access": "public",

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
- "v*.*.*"
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
environment: production
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
fetch-depth: 0 # Full history for changelog generation
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
21+
with:
22+
node-version-file: ".nvmrc"
23+
24+
- name: Use corepack to activate pnpm
25+
run: npm i -g corepack@0.31.0 && corepack enable
26+
shell: bash
27+
28+
- name: Audit dependencies (before installing anything)
29+
# Ignore "low" and "moderate" advisories for now.
30+
run: pnpm audit --audit-level high
31+
shell: bash
32+
33+
- name: Get pnpm store directory (for caching)
34+
id: pnpm-cache-dir
35+
run: |
36+
echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT
37+
shell: bash
38+
39+
# https://github.com/actions/cache
40+
- name: Setup pnpm store cache
41+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
42+
with:
43+
path: ${{ steps.pnpm-cache-dir.outputs.dir }}
44+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
45+
restore-keys: |
46+
${{ runner.os }}-pnpm-store-
47+
env:
48+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
49+
50+
- name: Audit the lockfiles to catch peer dependency issues
51+
run: pnpm install -r --lockfile-only
52+
shell: bash
53+
54+
- name: Install dependencies
55+
run: pnpm install -r --frozen-lockfile
56+
shell: bash
57+
58+
- name: Create PR with changelog
59+
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10
60+
with:
61+
version: pnpm run changeset version # Updates versions and changelog
62+
# publish: pnpm run changeset publish # Publishes to npm
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For changelog links
65+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # For npm publish

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"pnpm": "^8.0.0"
2626
},
2727
"devDependencies": {
28+
"@changesets/changelog-github": "^0.5.1",
2829
"@changesets/cli": "^2.27.5",
2930
"@jest/globals": "^29.3.1",
3031
"@jest/types": "^29.3.1",

pnpm-lock.yaml

Lines changed: 48 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)