From db3d970fbf5c0d1294471657f6522da4f464f484 Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Wed, 15 May 2019 10:41:53 +0200 Subject: [PATCH 1/3] chore: Added npm release script --- scripts/postversion/release-storybook.js | 2 +- scripts/release/release.sh | 34 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100755 scripts/release/release.sh diff --git a/scripts/postversion/release-storybook.js b/scripts/postversion/release-storybook.js index ea7a40f702b..36379433f98 100644 --- a/scripts/postversion/release-storybook.js +++ b/scripts/postversion/release-storybook.js @@ -13,7 +13,7 @@ module.exports = new Promise((resolve) => { } highlightLog('Deploy Storybook'); - shell.exec('node_modules/.bin/storybook-to-ghpages --existing-output-dir .out'); + shell.exec('node_modules/.bin/storybook-to-ghpages --ci --existing-output-dir .out'); highlightLog('Storybooks deployed successfully'); resolve(); diff --git a/scripts/release/release.sh b/scripts/release/release.sh new file mode 100755 index 00000000000..1143e020f05 --- /dev/null +++ b/scripts/release/release.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# make sure we are on the master branch +git checkout master + +# install dependencies +yarn install --mutex network + +# run tests +yarn test + +# trigger lerna release and create new storybook +./node_modules/.bin/lerna version \ + --conventional-commits \ + --exact \ + --github-release \ + --yes + +# build the project with the new version after lerna version +yarn build + +# if we came to that point we are ready for publish + +# create npmrc with auth +bash $WORKSPACE/scripts/ci/setup-npm.sh + +# now start publishing each package +cd $WORKSPACE/build/node_modules/charts && npm publish --access public +cd $WORKSPACE/build/node_modules/fiori3 && npm publish --access public +cd $WORKSPACE/build/node_modules/styles && npm publish --access public +cd $WORKSPACE/build/node_modules/utils && npm publish --access public + +# all packages are now released, clear npm-session +rm ~/.npmrc From a890ae65fca1eef9765f5b85dccefea7aa82d573 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Wed, 15 May 2019 11:26:22 +0200 Subject: [PATCH 2/3] chore: Create a branch for each release --- scripts/release/release.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/release/release.sh b/scripts/release/release.sh index 1143e020f05..3af88248d0c 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -14,21 +14,28 @@ yarn test --conventional-commits \ --exact \ --github-release \ + --no-push \ --yes +# get the new version number +RELEASE_VERSION=$(node -p "require('./lerna.json').version") +# get the new version number +git checkout -b releases/${RELEASE_VERSION} +git push --set-upstream origin releases/${RELEASE_VERSION} + # build the project with the new version after lerna version yarn build # if we came to that point we are ready for publish # create npmrc with auth -bash $WORKSPACE/scripts/ci/setup-npm.sh +bash ${WORKSPACE}/scripts/ci/setup-npm.sh # now start publishing each package -cd $WORKSPACE/build/node_modules/charts && npm publish --access public -cd $WORKSPACE/build/node_modules/fiori3 && npm publish --access public -cd $WORKSPACE/build/node_modules/styles && npm publish --access public -cd $WORKSPACE/build/node_modules/utils && npm publish --access public +cd ${WORKSPACE}/build/node_modules/charts && npm publish --access public +cd ${WORKSPACE}/build/node_modules/fiori3 && npm publish --access public +cd ${WORKSPACE}/build/node_modules/styles && npm publish --access public +cd ${WORKSPACE}/build/node_modules/utils && npm publish --access public # all packages are now released, clear npm-session rm ~/.npmrc From e6748451fbb20801b752be888949e182a62242c2 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Wed, 15 May 2019 11:32:09 +0200 Subject: [PATCH 3/3] WIP: Intendation --- scripts/release/release.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/release/release.sh b/scripts/release/release.sh index 3af88248d0c..7a7b8fb7774 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -13,9 +13,9 @@ yarn test ./node_modules/.bin/lerna version \ --conventional-commits \ --exact \ - --github-release \ - --no-push \ - --yes + --github-release \ + --no-push \ + --yes # get the new version number RELEASE_VERSION=$(node -p "require('./lerna.json').version")