Skip to content

Commit

Permalink
Add publish script and PUBLISHING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ahocevar committed Oct 10, 2024
1 parent 79c160a commit 3a993e5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Publishing

Make sure you have the latest from the main branch:

git pull origin main

Use `npm version` to update the version number in the `package.json`.

npm version {patch|minor|major} --no-git-tag-version

Then run the publish script

./publish.sh

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:

npm version 1.1.2-dev
git push --follow-tags
21 changes: 21 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# get current version
VERSION=$(node -e "console.log(require('./package.json').version)")

# Build
git checkout -b build
npm run build
git add dist -f
git commit -m "build $VERSION"

# Tag and push
git tag -f v$VERSION -m "$VERSION"
git push --tags git@github.com:proj4js/wkt-parser.git $VERSION

# Publish
npm publish

# Cleanup
git checkout main
git branch -D build

0 comments on commit 3a993e5

Please sign in to comment.