From 660ae2edc42fe12df51c1ba614c65ee0573f4b0b Mon Sep 17 00:00:00 2001 From: Eason chiu <76670758@qq.com> Date: Mon, 2 Aug 2021 16:08:28 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BF=AE=E6=94=B9=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- scripts/publish.sh | 10 ++++++++++ scripts/release.sh | 36 ------------------------------------ 3 files changed, 12 insertions(+), 38 deletions(-) create mode 100644 scripts/publish.sh delete mode 100644 scripts/release.sh diff --git a/package.json b/package.json index b70a7a7..88bb5fa 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "scripts": { "start": "cross-env NODE_ENV=development PACKAGE=development node scripts/start.js", "build": "cross-env NODE_ENV=production PACKAGE=production node scripts/build.js", - "release": "sh scripts/release.sh", "clean": "rimraf build", "ci": "yarn commit", "commit": "git-cz", @@ -25,7 +24,8 @@ "lint": "tsc --build tsconfig.build.json && node node_modules/tslint/bin/tslint -c ./tslint.json -p ./tsconfig.build.json", "lint-staged": "lint-staged", "np": "np --no-cleanup --yolo --no-publish", - "prepublishOnly": "yarn clean && yarn prettier && yarn lint && yarn build && yarn np" + "ps": "sh ./scripts/publish.sh", + "prepublishOnly": "yarn clean && yarn prettier && yarn lint && yarn build && yarn ps" }, "publishConfig": { "registry": "http://registry.npmjs.org" diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100644 index 0000000..dca5abd --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo 'publish with proxy:' +git config --global http.https://github.com.proxy http://127.0.0.1:10080 +git config --global https.https://github.com.proxy https://127.0.0.1:10080 +git config --global http.https://github.com.proxy +git config --global https.https://github.com.proxy +yarn np +git config --global --unset http.https://github.com.proxy +git config --global --unset https.https://github.com.proxy diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100644 index 65be7b9..0000000 --- a/scripts/release.sh +++ /dev/null @@ -1,36 +0,0 @@ - -git checkout master -git merge dev - -#!/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 - # build - npm version $VERSION --no-git-tag-version - VERSION=$VERSION - - # commit - git tag v$VERSION - git commit -am "build: release $VERSION" - - # publish - git push origin master - git push origin refs/tags/v$VERSION - git checkout dev - git rebase master - git push origin dev - - npm run build - npm publish - - # docs - npm run changelog - git commit -am "docs: add $VERSION docs" - git push origin dev -fi