Skip to content

Commit a447216

Browse files
authored
Release flow based on npm version (#29)
1 parent ec9fd42 commit a447216

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

DEVELOPING.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,16 @@ This gRPC library depends on the `protobuf-ts` package, which is not compatible
4040

4141
## How to publish
4242

43-
Make sure that you're on a clean commit, and all version numbers have been updated.
43+
Make sure that you're on a clean commit, then:
4444

4545
```bash
46-
VERSION=0.0.X
47-
48-
git tag modal-go/v$VERSION
49-
git push --tags
50-
GOPROXY=proxy.golang.org go list -m github.com/modal-labs/libmodal/modal-go@v$VERSION
46+
npm version patch # will build, bump the version, commit, tag, push, and npm publish
5147
```
5248

5349
```bash
54-
VERSION=0.0.X
55-
56-
# Note: Edit package.json first
57-
npm run build
58-
npm publish
50+
GO_VERSION=0.0.X
5951

60-
git tag modal-js/v$VERSION
52+
git tag modal-go/v$GO_VERSION
6153
git push --tags
54+
GOPROXY=proxy.golang.org go list -m github.com/modal-labs/libmodal/modal-go@v$GO_VERSION
6255
```

modal-js/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
"format:check": "prettier --check .",
3030
"lint": "eslint",
3131
"prepare": "scripts/gen-proto.sh",
32-
"test": "vitest"
32+
"test": "vitest",
33+
"preversion": "(git update-index --really-refresh && git diff-index --quiet HEAD) || (echo 'You must commit all changes before running npm version' && exit 1)",
34+
"version": "npm run build && git add package.json package-lock.json && git commit -m \"modal-js/v$npm_package_version\" && git tag modal-js/v$npm_package_version",
35+
"postversion": "git push && git push --tags && npm publish"
3336
},
3437
"dependencies": {
3538
"long": "^5.3.1",

0 commit comments

Comments
 (0)