Skip to content

Commit 3a993e5

Browse files
committed
Add publish script and PUBLISHING.md
1 parent 79c160a commit 3a993e5

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Diff for: PUBLISHING.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Publishing
2+
3+
Make sure you have the latest from the main branch:
4+
5+
git pull origin main
6+
7+
Use `npm version` to update the version number in the `package.json`.
8+
9+
npm version {patch|minor|major} --no-git-tag-version
10+
11+
Then run the publish script
12+
13+
./publish.sh
14+
15+
afterwards don't forget to update the versions to be a prerelease of the next version, so if you just published 1.1.1 then:
16+
17+
npm version 1.1.2-dev
18+
git push --follow-tags

Diff for: publish.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# get current version
4+
VERSION=$(node -e "console.log(require('./package.json').version)")
5+
6+
# Build
7+
git checkout -b build
8+
npm run build
9+
git add dist -f
10+
git commit -m "build $VERSION"
11+
12+
# Tag and push
13+
git tag -f v$VERSION -m "$VERSION"
14+
git push --tags [email protected]:proj4js/wkt-parser.git $VERSION
15+
16+
# Publish
17+
npm publish
18+
19+
# Cleanup
20+
git checkout main
21+
git branch -D build

0 commit comments

Comments
 (0)