Add release script (#49)

This commit is contained in:
Fabrizio Ferrai 2021-04-19 13:44:58 +03:00 committed by GitHub
parent 8925f21cb2
commit d8624318c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

24
release.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
# Please use this script to cut new releases.
# It will create a tag and push it, which will trigger CI to create a release,
# build release files, push them to the release, and publish a new version on NPM
NEW_TAG=v$(jq -r ".version" package.json)
# Fail if the new tag already exists
if git rev-parse "${NEW_TAG}" >/dev/null 2>&1; then
echo "Tag '${NEW_TAG}' already exists, please bump the version in package.json";
exit 1;
fi
echo "Creating and pushing new tag '${NEW_TAG}'.."
git tag "${NEW_TAG}"
git push origin "${NEW_TAG}"
echo "Done."