Skip to content

Commit d862431

Browse files
authored
Add release script (#49)
1 parent 8925f21 commit d862431

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

release.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# Please use this script to cut new releases.
6+
# It will create a tag and push it, which will trigger CI to create a release,
7+
# build release files, push them to the release, and publish a new version on NPM
8+
9+
NEW_TAG=v$(jq -r ".version" package.json)
10+
11+
# Fail if the new tag already exists
12+
if git rev-parse "${NEW_TAG}" >/dev/null 2>&1; then
13+
echo "Tag '${NEW_TAG}' already exists, please bump the version in package.json";
14+
exit 1;
15+
fi
16+
17+
echo "Creating and pushing new tag '${NEW_TAG}'.."
18+
19+
git tag "${NEW_TAG}"
20+
21+
git push origin "${NEW_TAG}"
22+
23+
echo "Done."
24+

0 commit comments

Comments
 (0)