mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
add release shell (#35)
This commit is contained in:
parent
08ba48621a
commit
3b934df32e
20
build/build-changelog.sh
Normal file
20
build/build-changelog.sh
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
if ! command_exists github_changelog_generator ; then
|
||||||
|
fail 'github_changelog_generator is required to publish packages'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CHANGELOG_GITHUB_TOKEN" ] ; then
|
||||||
|
fail 'You must set CHANGELOG_GITHUB_TOKEN environment variable\nhttps://github.com/skywinder/github-changelog-generator#github-token'
|
||||||
|
fi
|
||||||
|
|
||||||
|
basepath=$(dirname $0)
|
||||||
|
|
||||||
|
github_changelog_generator \
|
||||||
|
--header-label "## 更新日志" \
|
||||||
|
--bugs-label "**Bug Fixes**" \
|
||||||
|
--enhancement-label "**Breaking changes**" \
|
||||||
|
--issues-label "**Issue**" \
|
||||||
|
--pr-label "**Improvements**" \
|
||||||
|
--no-unreleased \
|
||||||
|
-o $basepath/../CHANGELOG-GENERATED.md
|
24
build/releash.sh
Normal file
24
build/releash.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
git checkout master
|
||||||
|
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
echo "Enter release version: "
|
||||||
|
read VERSION
|
||||||
|
|
||||||
|
read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
|
||||||
|
echo # (optional) move to a new line
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
echo "Releasing $VERSION ..."
|
||||||
|
|
||||||
|
# commit
|
||||||
|
git add -A
|
||||||
|
git commit -m "[build] $VERSION"
|
||||||
|
npm version $VERSION --message "[release] $VERSION"
|
||||||
|
|
||||||
|
# publish
|
||||||
|
git push origin master
|
||||||
|
git push origin refs/tags/v$VERSION
|
||||||
|
|
||||||
|
npm publish
|
||||||
|
fi
|
@ -7,7 +7,8 @@
|
|||||||
"example": "example"
|
"example": "example"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"release": "sh build/release.sh",
|
||||||
|
"changelog": "sh build/build-changelog.sh"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user