Skip to content

Commit 338aef8

Browse files
authored
Add release process (#771)
* readme: Document release process * npm/yarn: Remove publishing scripts
1 parent 89ff08d commit 338aef8

File tree

2 files changed

+84
-5
lines changed

2 files changed

+84
-5
lines changed

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,89 @@ The Graph CLI can be used with a local or self-hosted [Graph Node](https://githu
5353

5454
If you are ready to dive into the details of building a subgraph from scratch, there is a [detailed walkthrough](https://thegraph.com/docs/define-a-subgraph) for that as well, along with API documentation for the [AssemblyScript API](https://thegraph.com/docs/assemblyscript-api).
5555

56+
## Release process
57+
58+
The steps to create a new version of the `graph-cli` are:
59+
60+
1. Decide which version number you'll be rolling out. You can check the differences between the current `master` branch and the latest release.
61+
2. Create a PR with the commit generated by `npm version <VERSION> [<PREID>]`.
62+
3. Once that's approved and merged to `master`, you can publish it to `npm` and push the git tags as well.
63+
4. Last but not least, create a Github Release refering to the pushed git tag, linking to the PRs involved.
64+
65+
Helpful links:
66+
67+
- [Semver official docs](https://semver.org/)
68+
- [`npm version` docs](https://docs.npmjs.com/cli/v7/commands/npm-version)
69+
- [`npm publish` docs](https://docs.npmjs.com/cli/v7/commands/npm-publish)
70+
- [`npm unpublish` docs](https://docs.npmjs.com/cli/v7/commands/npm-unpublish)
71+
- [`npm deprecate` docs](https://docs.npmjs.com/cli/v7/commands/npm-deprecate)
72+
73+
### Stable release example
74+
75+
Current version: `0.34.9`.
76+
Desired release: `0.35.0`.
77+
78+
To create the PR:
79+
```
80+
git checkout -b <BRANCH>
81+
82+
npm version minor
83+
84+
git push --set-upstream <REMOTE> <BRANCH>
85+
```
86+
87+
Once that's approved and merged, you can update your local `master` and:
88+
89+
```
90+
npm publish
91+
92+
npm push --tags
93+
```
94+
95+
### Alpha release example
96+
97+
Current version: `0.29.2`.
98+
Desired release: `0.30.0-alpha.0`.
99+
100+
To create the PR:
101+
```
102+
git checkout -b <BRANCH>
103+
104+
npm version preminor --preid alpha
105+
106+
git push --set-upstream <REMOTE> <BRANCH>
107+
```
108+
109+
Once that's approved and merged, you can update your local `master` and:
110+
111+
```
112+
npm publish --tag alpha
113+
114+
npm push --tags
115+
```
116+
117+
### Alpha pre-release example
118+
119+
Current version: `0.30.0-alpha.0`.
120+
Desired release: `0.30.0-alpha.1`.
121+
122+
To create the PR:
123+
```
124+
git checkout -b <BRANCH>
125+
126+
npm version prerelease --preid alpha
127+
128+
git push --set-upstream <REMOTE> <BRANCH>
129+
```
130+
131+
Once that's approved and merged, you can update your local `master` and:
132+
133+
```
134+
npm publish --tag alpha
135+
136+
npm push --tags
137+
```
138+
56139
## License
57140

58141
Copyright &copy; 2018-2019 Graph Protocol, Inc. and contributors.

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
"scripts": {
4141
"test": "jest --verbose",
4242
"test:init": "jest tests/cli/init.test.js --verbose",
43-
"test:validation": "jest tests/cli/validation.test.js --verbose",
44-
"release:patch": "npm version patch && npm publish && git push origin master && git push --tags",
45-
"release:minor": "npm version minor && npm publish && git push origin master && git push --tags",
46-
"release:alpha:minor": "npm version preminor --preid alpha && npm publish --tag alpha && git push origin master && git push --tags",
47-
"release:alpha:prerelease": "npm version prerelease --preid alpha && npm publish --tag alpha && git push origin master && git push --tags"
43+
"test:validation": "jest tests/cli/validation.test.js --verbose"
4844
}
4945
}

0 commit comments

Comments
 (0)