]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
build: add release scripts
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 4 Mar 2021 15:21:56 +0000 (16:21 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 8 Mar 2021 14:50:05 +0000 (15:50 +0100)
.checklist.md [deleted file]
.release-it.json [deleted file]
scripts/release.sh [new file with mode: 0644]

diff --git a/.checklist.md b/.checklist.md
deleted file mode 100644 (file)
index f0d89e5..0000000
+++ /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 (file)
index d2dad11..0000000
+++ /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 (file)
index 0000000..76cfb8e
--- /dev/null
@@ -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