Skip to content

Commit 8ed1b3e

Browse files
committed
add changesets to 17.x.x alpha
NOTE: publishing is set to dry-run
1 parent d41f59b commit 8ed1b3e

File tree

10 files changed

+1145
-22
lines changed

10 files changed

+1145
-22
lines changed

.changeset/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changesets in graphql-js
2+
3+
This repo uses Changesets to manage version bumps and release PR automation.
4+
5+
## Contributor flow
6+
7+
1. Add a changeset file when the PR should affect a published package:
8+
- `npm run changeset`
9+
- Choose `patch`, `minor`, or `major` for `graphql`
10+
2. Commit the generated `.changeset/*.md` file.
11+
12+
## Release lines
13+
14+
Changesets automation is currently enabled only on `17.x.x`.

.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.0.0/schema.json",
3+
"changelog": false,
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "17.x.x",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mode": "pre",
3+
"tag": "alpha",
4+
"initialVersions": {
5+
"graphql": "17.0.0-alpha.10"
6+
},
7+
"changesets": []
8+
}

.changeset/wacky-streets-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'graphql': patch
3+
---
4+
5+
Add changesets to 17.x.x alpha

.github/CONTRIBUTING.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,11 @@ Feel free to reach out via the [graphql-js channel](https://discord.com/channels
8686

8787
## Release on NPM
8888

89-
_Only core contributors may release to NPM._
90-
91-
To release a new version on NPM, first ensure all tests pass with `npm test`,
92-
then use `npm version patch|minor|major` in order to increment the version in
93-
package.json and tag and commit a release. Then `git push && git push --tags`
94-
to sync this change with source control. Then `npm publish npmDist` to actually
95-
publish the release to NPM.
96-
Once published, add [release notes](https://github.com/graphql/graphql-js/releases).
97-
Use [semver](https://semver.org/) to determine which version part to increment.
98-
99-
Example for a patch release:
100-
101-
```sh
102-
npm ci
103-
npm test
104-
npm version patch --ignore-scripts=false
105-
git push --follow-tags
106-
cd npmDist && npm publish
107-
npm run changelog
108-
```
109-
110-
Then upload the changelog to [https://github.com/graphql/graphql-js/releases](https://github.com/graphql/graphql-js/releases).
89+
Releases are managed by Changesets and GitHub Actions:
90+
91+
- Contributors add changesets in PRs (`npm run changeset`) for user-facing changes.
92+
- Changesets release automation is currently enabled only on `17.x.x`.
93+
- Merging the release PR triggers publish to NPM.
11194

11295
## License
11396

.github/workflows/changesets.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Changesets
2+
on:
3+
push:
4+
branches:
5+
- 17.x.x
6+
workflow_dispatch:
7+
permissions: {}
8+
jobs:
9+
release:
10+
name: Create release PR or publish
11+
if: ${{ !github.event.repository.fork && github.ref_name == '17.x.x' }}
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref_name }}
15+
cancel-in-progress: true
16+
permissions:
17+
contents: write # for changesets action to commit/tag
18+
pull-requests: write # for changesets action to create/update release PR
19+
id-token: write # for npm trusted publishing via OIDC
20+
steps:
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
cache: npm
31+
node-version-file: '.node-version'
32+
33+
- name: Install Dependencies
34+
run: npm ci --ignore-scripts
35+
36+
- name: Run Changesets
37+
uses: changesets/action@v1
38+
with:
39+
title: 'chore(release): version packages'
40+
commit: 'chore(release): version packages'
41+
version: npm run release:version
42+
publish: npm run release:publish
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)