forked from tj/n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease
executable file
·49 lines (37 loc) · 1.16 KB
/
release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Run this from the develop branch after setting the version number in bin/n,
# when ready to release apart from copying up to master and tagging.
{ # force scan of whole file into memory so not affected by changing branches and self-modifying.
#
# confirm <message>
#
function confirm {
read -p "$1 " -r
if [[ ! "${REPLY}" =~ ^[Yy]$ ]]; then
echo "Stopping"
exit 2
fi
}
readonly N_VERSION="$(n --version)"
if [[ "${N_VERSION}" =~ ^[0-9.]+-[0-9]+$ ]]; then
echo "Error: internal version number still prerelease, set it to desired version first."
exit 2
fi
confirm "Are you releasing version '${N_VERSION}' ?"
confirm "Have you updated CHANGELOG?"
confirm "Are you running this from a shell with full internet access (not through proxy to run tests)?"
git checkout master
git merge develop
npm version "${N_VERSION}"
read -p "One Time Password for npm publish: " -r
set -x
npm publish . --otp "${REPLY}"
git push --follow-tags
git checkout develop
git merge master
npm version -no-git-tag-version prepatch
set +x
echo "Reminder: update the internal number to match."
echo "Reminder: add release description to github (from CHANGELOG)"
exit
}