From: Eduardo San Martin Morote Date: Thu, 4 Mar 2021 15:21:56 +0000 (+0100) Subject: build: add release scripts X-Git-Tag: v0.2.0~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77d6ffdc4625ab8866db8a36e144600985675af2;p=thirdparty%2Fvuejs%2Fpinia.git build: add release scripts --- diff --git a/.checklist.md b/.checklist.md deleted file mode 100644 index f0d89e5c..00000000 --- a/.checklist.md +++ /dev/null @@ -1,30 +0,0 @@ -# Checklist of things to do when creating a lib - -## Copying the project - -- `cp -r lib-boilerplate-ts my-new-lib` (careful copying `node_modules`) -- `rm -rf .git` -- `rm .checklist.md` -- `git init .` -- `git add .` -- `git commit -m 'init'` -- `sed -i '' 's/lib-boilerplate-ts/vue-local-scope/g' README.md package.json` - -## circle ci - -- Add the project: https://circleci.com/projects/gh/posva -- Check _Build on forked pull requests_: https://circleci.com/gh/posva/vue-tweezing/edit#advanced-settings -- Check _Auto cancel redundant build_ (same place) - -## Greenkeeper - -- Activate it: https://github.com/settings/installations/5583 -- Merge its first pull request - -## Beerpay - -- Add project: https://beerpay.io/dashboard/projects/add - -## Github Settings - -- Activate probot/settings: https://github.com/settings/installations/85597 diff --git a/.release-it.json b/.release-it.json deleted file mode 100644 index d2dad112..00000000 --- a/.release-it.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "src": { - "tagName": "v%s", - "commitMessage": "chore(release): %s" - }, - "github": { - "release": true, - "releaseName": "🚀 Release %s", - "tokenRef": "GITHUB_TOKEN" - }, - "npm": { - "publish": true - }, - "changelogCommand": "git log --pretty=\"format:'* %s (%h)'\" [REV_RANGE] | grep -vE '(chore|test|refactor|docs)'" -} diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 00000000..76cfb8ed --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,41 @@ +set -e +echo "Current version:" $(grep version package.json | sed -E 's/^.*"(4[^"]+)".*$/\1/') +echo "Enter alpha version e.g., 2 will generate 2.0.0-alpha.2: " +read ALPHA + +VERSION="2.0.0-alpha.$ALPHA" + +read -p "Releasing v$VERSION - are you sure? (y/n)" -n 1 -r +echo # (optional) move to a new line +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo "Releasing v$VERSION ..." + + # clear existing ts cache + rm -rf node_modules/.rts2_cache + + # generate the version so that the changelog can be generated too + yarn version --no-git-tag-version --no-commit-hooks --new-version $VERSION + + yarn run build + yarn run build:dts + yarn run test:dts + + # changelog + yarn run changelog + yarn prettier --write CHANGELOG.md + echo "Please check the git history and the changelog and press enter" + read OKAY + + # commit and tag + git add CHANGELOG.md package.json + git commit -m "release: v$VERSION" + git tag "v$VERSION" + + # commit + yarn publish --tag next --new-version "$VERSION" --no-commit-hooks --no-git-tag-version + + # publish + git push origin refs/tags/v$VERSION + git push +fi