Skip to content

Commit 38e8a48

Browse files
ci: introduce changesets
1 parent d538a90 commit 38e8a48

File tree

11 files changed

+531
-123
lines changed

11 files changed

+531
-123
lines changed

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "TanStack/table" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main",
10+
"updateInternalDependencies": "patch",
11+
"fixed": [],
12+
"linked": [],
13+
"ignore": []
14+
}

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## 🎯 Changes
2+
3+
<!-- What changes are made in this PR? Describe the change and its motivation. -->
4+
5+
## ✅ Checklist
6+
7+
- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/table/blob/main/CONTRIBUTING.md).
8+
- [ ] I have tested this code locally with `pnpm test:pr`.
9+
10+
## 🚀 Release Impact
11+
12+
- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
13+
- [ ] This change is docs/CI/dev-only (no release).

.github/workflows/autofix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5.0.0
22+
with:
23+
fetch-depth: 0
2224
- name: Setup Tools
2325
uses: tanstack/config/.github/setup@main
2426
- name: Fix formatting

.github/workflows/pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pr
1+
name: PR
22

33
on:
44
pull_request:
@@ -23,15 +23,15 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5.0.0
2727
with:
2828
fetch-depth: 0
2929
- name: Start Nx Agents
3030
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
3131
- name: Setup Tools
3232
uses: tanstack/config/.github/setup@main
3333
- name: Get base and head commits for `nx affected`
34-
uses: nrwl/nx-set-shas@v4
34+
uses: nrwl/nx-set-shas@v4.3.3
3535
with:
3636
main-branch-name: main
3737
- name: Run Checks
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@v4
47+
uses: actions/checkout@v5.0.0
4848
with:
4949
fetch-depth: 0
5050
- name: Setup Tools
Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: ci
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
tag:
7-
description: override release tag
8-
required: false
94
push:
105
branches: [main, alpha, beta, rc]
116

@@ -19,15 +14,16 @@ env:
1914
permissions:
2015
contents: write
2116
id-token: write
17+
pull-requests: write
2218

2319
jobs:
24-
test-and-publish:
25-
name: Test & Publish
26-
if: github.repository == 'TanStack/table'
20+
release:
21+
name: Release
22+
if: github.repository_owner == 'TanStack'
2723
runs-on: ubuntu-latest
2824
steps:
2925
- name: Checkout
30-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5.0.0
3127
with:
3228
fetch-depth: 0
3329
- name: Start Nx Agents
@@ -39,13 +35,13 @@ jobs:
3935
- name: Stop Nx Agents
4036
if: ${{ always() }}
4137
run: npx nx-cloud stop-all-agents
42-
- name: Publish
43-
run: |
44-
git config --global user.name 'Tanner Linsley'
45-
git config --global user.email 'tannerlinsley@users.noreply.github.com'
46-
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
47-
pnpm run cipublish
38+
- name: Run Changesets (version or publish)
39+
uses: changesets/action@v1.5.3
40+
with:
41+
version: pnpm run changeset:version
42+
publish: pnpm run changeset:publish
43+
commit: 'ci: Version Packages'
44+
title: 'ci: Version Packages'
4845
env:
49-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5047
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51-
TAG: ${{ inputs.tag }}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"prettier": "prettier --ignore-unknown '**/*'",
2525
"prettier:write": "pnpm run prettier --write",
2626
"verify-links": "node scripts/verify-links.ts",
27-
"cipublish": "node scripts/publish.js"
27+
"changeset": "changeset",
28+
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write",
29+
"changeset:publish": "changeset publish"
2830
},
2931
"nx": {
3032
"includedScripts": [
@@ -48,13 +50,15 @@
4850
"@babel/preset-env": "^7.24.7",
4951
"@babel/preset-react": "^7.24.7",
5052
"@babel/preset-typescript": "^7.24.7",
53+
"@changesets/cli": "^2.29.7",
5154
"@faker-js/faker": "^8.4.1",
5255
"@rollup/plugin-babel": "^6.0.4",
5356
"@rollup/plugin-commonjs": "^26.0.1",
5457
"@rollup/plugin-node-resolve": "^15.2.3",
5558
"@rollup/plugin-replace": "^5.0.7",
5659
"@rollup/plugin-terser": "^0.4.4",
5760
"@size-limit/preset-small-lib": "^11.1.4",
61+
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
5862
"@tanstack/config": "^0.13.0",
5963
"@testing-library/jest-dom": "^6.4.6",
6064
"@testing-library/react": "^16.0.0",

0 commit comments

Comments
 (0)