Compare commits
2 commits
dc1b87b87d
...
e634919e43
Author | SHA1 | Date | |
---|---|---|---|
e634919e43 | |||
597f750695 |
1 changed files with 17 additions and 1 deletions
18
release.sh
18
release.sh
|
@ -2,6 +2,22 @@
|
||||||
set -e
|
set -e
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "Uncommitted changes"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "Invalid version '$1'";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update package version
|
||||||
|
contents="$(jq ".version = \"$1\"" package.json)"
|
||||||
|
echo -E "${contents}" > package.json
|
||||||
|
pnpm i
|
||||||
|
git add package.json pnpm-lock.yaml
|
||||||
|
|
||||||
CHANGELOG="CHANGELOG.md"
|
CHANGELOG="CHANGELOG.md"
|
||||||
|
|
||||||
VERSION=$(jq -r '.version' package.json)
|
VERSION=$(jq -r '.version' package.json)
|
||||||
|
@ -20,7 +36,7 @@ fi
|
||||||
|
|
||||||
editor "$CHANGELOG"
|
editor "$CHANGELOG"
|
||||||
|
|
||||||
git add package.json "$CHANGELOG"
|
git add "$CHANGELOG"
|
||||||
git commit -m "chore(release): release v$VERSION"
|
git commit -m "chore(release): release v$VERSION"
|
||||||
|
|
||||||
awk 'BEGIN{RS="(^|\n)## [^\n]+\n*"} NR==2 { print }' "$CHANGELOG" | git tag -as -F - --cleanup whitespace "$TAG"
|
awk 'BEGIN{RS="(^|\n)## [^\n]+\n*"} NR==2 { print }' "$CHANGELOG" | git tag -as -F - --cleanup whitespace "$TAG"
|
||||||
|
|
Loading…
Reference in a new issue