-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy patht
executable file
·66 lines (52 loc) · 1.62 KB
/
t
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# A simple script to automate tasks.
set -e
changelog() {
# NOTE: This requires github_changelog_generator to be installed.
# https://github.com/skywinder/github-changelog-generator
if [ -z "$NEXT" ]; then
NEXT="next"
fi
echo "Generating changelog upto version: $NEXT"
github_changelog_generator \
--no-verbose \
--pr-label "**Changes**" \
--bugs-label "**Bug Fixes**" \
--issues-label "**Closed Issues**" \
--issue-line-labels=ALL \
--future-release="$NEXT" \
--release-branch=master \
--exclude-labels=unnecessary,duplicate,question,invalid,wontfix
}
build() {
rimraf dist test/dist mod.d.ts && \
rollup -c rollup.config.js && \
mv dist/mod.d.ts .
}
test() {
echo;\
echo "Tests for Node (common js)" && mocha test/node.test.js && \
echo "Tests for Browser" && mocha-headless-chrome -f test/browser.test.html && \
echo "Tests for Deno" && deno test/deno.test.ts --reload
}
bump() {
# Bump package version and generate changelog
VERSION="${NEXT/v/}"
echo "Bump version to ${VERSION}"
# Update version in the following files
sed -i "s/\(\"version\":\s*\"\)[^\"]*\(\"\)/\1${VERSION}\2/g" package.json
# Generate change log
changelog
echo ""
# Generate new build.
yarn && test && build
# Prepare to commit
git add CHANGELOG.md README.md package.json yarn.lock && \
git commit -v --edit -m "${VERSION} Release :tada: :fireworks: :bell:" && \
git tag "$NEXT" && \
echo -e "\nRelease tagged $NEXT"
git push origin master --tags
yarn publish --new-version "${VERSION}" --no-git-tag-version
}
# Run command received from args.
$1