forked from atlassian/gajira-find-issue-key
-
Notifications
You must be signed in to change notification settings - Fork 9
/
release.sh
executable file
·31 lines (28 loc) · 1006 Bytes
/
release.sh
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
#!/usr/bin/env bash
git fetch --tags
bump="${1:-patch}"
yarn version -i "${bump}" || true
newtag="v$(jq -r '.version' package.json)"
yarn run generate-docs
yarn build
git add lib package.json yarn.lock .yarn release.sh lib README.md
git commit -m "chore(release): bump version to ${newtag}" --no-verify
# newtag2="$(git semver get)"
# if [[ "${newtag}" != "${newtag2}" ]]; then
# echo "ERROR: new tag does not match expected tag"
# echo " expected: ${newtag}"
# echo " actual: ${newtag2}"
# exit 1
# fi
stub_major="${newtag%%\.*}"
stub_major_minor="${newtag%\.*}"
git tag -d "${stub_major}" 2>/dev/null || true
git tag -d "${stub_major_minor}" 2>/dev/null || true
git tag -a "${stub_major}" -m "Release ${newtag}"
git tag -a "${stub_major_minor}" -m "Release ${newtag}"
# git push origin ":${stub_major}" 2> /dev/null || true
# git push origin ":${stub_major_minor}" 2> /dev/null || true
# git push origin ":${newtag}" 2> /dev/null || true
git push -f --tags
git push -f
# yarn release:post