@@ -56,86 +56,31 @@ If you are ready to dive into the details of building a subgraph from scratch, t
56
56
57
57
## Release process
58
58
59
- The steps to create a new version of the ` graph-cli ` are :
59
+ We use ` changeset ` to manage releases. Every PR should include a changeset file. The release process is as follows :
60
60
61
- 1 . Decide which version number you'll be rolling out. You can check the differences between the current ` main ` branch and the latest release .
62
- 2 . Create a PR with the commit generated by ` npm version <VERSION> [<PREID>] ` .
63
- 3 . Once that's approved and merged to ` main ` , you can publish it to ` npm ` and push the git tags as well .
64
- 4 . Last but not least, create a Github Release refering to the pushed git tag, linking to the PRs involved .
61
+ 1 . Author creates the PR with changes and runs ` pnpm changeset ` to create a changeset file to summarize the changes .
62
+ 2 . When the PR is merged to ` main ` , a Github Action will run and create a PR with the version bump and changelog .
63
+ 3 . We will merge the bot generated PR to ` main ` .
64
+ 4 . A Github Action will run and publish the new version to npm .
65
65
66
66
Helpful links:
67
67
68
68
- [ Semver official docs] ( https://semver.org/ )
69
- - [ ` npm version ` docs] ( https://docs.npmjs.com/cli/v7/commands/npm-version )
70
- - [ ` npm publish ` docs] ( https://docs.npmjs.com/cli/v7/commands/npm-publish )
71
- - [ ` npm unpublish ` docs] ( https://docs.npmjs.com/cli/v7/commands/npm-unpublish )
72
- - [ ` npm deprecate ` docs] ( https://docs.npmjs.com/cli/v7/commands/npm-deprecate )
69
+ - [ Changesets] ( https://github.com/changesets/changesets )
70
+ - [ Snapshot release] ( https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md )
73
71
74
- ### Stable release example
75
-
76
- Current version: ` 0.34.9 ` .
77
- Desired release: ` 0.35.0 ` .
78
-
79
- To create the PR:
80
- ```
81
- git checkout -b <BRANCH>
82
72
83
- npm version minor
84
-
85
- git push --set-upstream <REMOTE> <BRANCH>
86
- ```
87
-
88
- Once that's approved and merged, you can update your local ` main ` and:
73
+ ### Stable release example
89
74
90
- ```
91
- npm publish
75
+ When PRs are merged and to ` main ` we can choose to merge the bot generated changeset PR to ` main ` and it will publish a new version to npm.
92
76
93
- npm push --tags
94
- ```
77
+ Example of a ` graph-client ` release: https://github.com/graphprotocol/graph-client/pull/295
95
78
96
79
### Alpha release example
97
80
98
- Current version: ` 0.29.2 ` .
99
- Desired release: ` 0.30.0-alpha.0 ` .
100
-
101
- To create the PR:
102
- ```
103
- git checkout -b <BRANCH>
104
-
105
- npm version preminor --preid alpha
106
-
107
- git push --set-upstream <REMOTE> <BRANCH>
108
- ```
109
-
110
- Once that's approved and merged, you can update your local ` main ` and:
81
+ Every PR to ` main ` that includes a changeset file will create a new alpha version.
111
82
112
- ```
113
- npm publish --tag alpha
114
-
115
- npm push --tags
116
- ```
117
-
118
- ### Alpha pre-release example
119
-
120
- Current version: ` 0.30.0-alpha.0 ` .
121
- Desired release: ` 0.30.0-alpha.1 ` .
122
-
123
- To create the PR:
124
- ```
125
- git checkout -b <BRANCH>
126
-
127
- npm version prerelease --preid alpha
128
-
129
- git push --set-upstream <REMOTE> <BRANCH>
130
- ```
131
-
132
- Once that's approved and merged, you can update your local ` main ` and:
133
-
134
- ```
135
- npm publish --tag alpha
136
-
137
- npm push --tags
138
- ```
83
+ Example of ` graph-client ` snapshot release: https://github.com/graphprotocol/graph-client/pull/178#issuecomment-1214822036
139
84
140
85
## License
141
86
0 commit comments