diff --git a/PUBLISHING.md b/PUBLISHING.md new file mode 100644 index 0000000..3e145d5 --- /dev/null +++ b/PUBLISHING.md @@ -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 diff --git a/publish.sh b/publish.sh new file mode 100644 index 0000000..62afab1 --- /dev/null +++ b/publish.sh @@ -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