Skip to content

Commit 88283a2

Browse files
ci: use changesets (#264)
1 parent a14fdb2 commit 88283a2

File tree

9 files changed

+528
-266
lines changed

9 files changed

+528
-266
lines changed

.changeset/config.json

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

.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/store/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v5.0.0
21+
uses: actions/checkout@v6.0.1
2222
with:
2323
fetch-depth: 0
2424
- name: Setup Tools
2525
uses: tanstack/config/.github/setup@main
2626
- name: Fix formatting
27-
run: pnpm prettier:write
27+
run: pnpm format
2828
- name: Generate Docs
2929
run: pnpm generate-docs
3030
- name: Apply fixes

.github/workflows/pr.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v5.0.0
22+
uses: actions/checkout@v6.0.1
2323
with:
2424
fetch-depth: 0
2525
- name: Start Nx Agents
2626
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
2727
- name: Setup Tools
2828
uses: tanstack/config/.github/setup@main
2929
- name: Get base and head commits for `nx affected`
30-
uses: nrwl/nx-set-shas@v4.3.3
30+
uses: nrwl/nx-set-shas@v4.4.0
3131
with:
3232
main-branch-name: main
3333
- name: Run Checks
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v5.0.0
43+
uses: actions/checkout@v6.0.1
4444
with:
4545
fetch-depth: 0
4646
- name: Setup Tools
@@ -49,3 +49,15 @@ jobs:
4949
run: pnpm run build:all
5050
- name: Publish Previews
5151
run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --no-template
52+
provenance:
53+
name: Provenance
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v6.0.1
58+
with:
59+
fetch-depth: 0
60+
- name: Check Provenance
61+
uses: danielroe/provenance-action@v0.1.1
62+
with:
63+
fail-on-downgrade: true

.github/workflows/release.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: Release
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]
116

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

2319
jobs:
2420
release:
@@ -27,25 +23,19 @@ jobs:
2723
runs-on: ubuntu-latest
2824
steps:
2925
- name: Checkout
30-
uses: actions/checkout@v5.0.0
26+
uses: actions/checkout@v6.0.1
3127
with:
3228
fetch-depth: 0
33-
- name: Start Nx Agents
34-
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
3529
- name: Setup Tools
3630
uses: tanstack/config/.github/setup@main
3731
- name: Run Tests
38-
run: pnpm run test:ci --parallel=3
39-
- name: Stop Nx Agents
40-
if: ${{ always() }}
41-
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
32+
run: pnpm run test:ci
33+
- name: Run Changesets (version or publish)
34+
uses: changesets/action@v1.5.3
35+
with:
36+
version: pnpm run changeset:version
37+
publish: pnpm run changeset:publish
38+
commit: 'ci: Version Packages'
39+
title: 'ci: Version Packages'
4840
env:
49-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51-
TAG: ${{ inputs.tag }}
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
"build:all": "nx run-many --target=build --exclude=examples/**",
2626
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all",
2727
"dev": "pnpm run watch",
28-
"prettier": "prettier --experimental-cli --ignore-unknown '**/*'",
29-
"prettier:write": "pnpm run prettier --write",
28+
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
3029
"generate-docs": "node scripts/generate-docs.ts",
31-
"cipublish": "node scripts/publish.ts",
32-
"cipublishforce": "CI=true pnpm cipublish"
30+
"changeset": "changeset",
31+
"changeset:publish": "changeset publish",
32+
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm format"
3333
},
3434
"nx": {
3535
"includedScripts": [
@@ -39,9 +39,10 @@
3939
]
4040
},
4141
"devDependencies": {
42+
"@changesets/cli": "^2.29.8",
4243
"@eslint-react/eslint-plugin": "^1.53.1",
44+
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
4345
"@tanstack/eslint-config": "0.3.3",
44-
"@tanstack/publish-config": "0.2.2",
4546
"@tanstack/typedoc-config": "0.3.1",
4647
"@tanstack/vite-config": "0.4.1",
4748
"@testing-library/jest-dom": "^6.9.1",

0 commit comments

Comments
 (0)