Skip to content

Commit

Permalink
chore(versioning): Use independent versioning (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusNotheis authored Dec 9, 2019
1 parent c4a213e commit 728756e
Show file tree
Hide file tree
Showing 35 changed files with 126 additions and 187 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- stage: 'Build and Deploy'
before_script:
- git checkout ${TRAVIS_BRANCH}
- bash ./scripts/ci/version-bump-snapshot.sh
script: yarn build
before_deploy:
- bash ./scripts/ci/setup-npm.sh
Expand Down
1 change: 0 additions & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = {
'^@shared/(.*)$': '<rootDir>/shared/$1',
'^@ui5/webcomponents-react/lib/(.*)$': '<rootDir>/packages/main/src/lib/$1',
'^@ui5/webcomponents-react-base/lib/(.*)$': '<rootDir>/packages/base/src/lib/$1',
'^@ui5/webcomponents-react-base/third-party/(.*)$': '<rootDir>/packages/base/src/third-party/$1',
'^@ui5/webcomponents-react-charts/lib/(.*)$': '<rootDir>/packages/charts/src/lib/$1',
'\\.(css|less)$': 'identity-obj-proxy'
},
Expand Down
13 changes: 9 additions & 4 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
"packages": [
"packages/*"
],
"version": "0.7.0-rc.1",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"version": {
"allowBranch": "master",
"conventionalCommits": true,
"exact": true,
"yes": true,
"preid": "rc",
"message": "chore(release): publish %s [ci skip]",
"forcePublish": true
"message": "chore(release): publish %s [ci skip]"
},
"publish": {
"allowBranch": "master",
"conventionalCommits": true,
"yes": true,
"preid": "rc",
"message": "chore(release): publish %s [ci skip]"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:storybook": "build-storybook -c packages/docs/.storybook -o .out",
"pretest": "node scripts/test/clean.js",
"test": "jest --config=config/jest.config.js --coverage",
"clean": "lerna clean --yes && node scripts/clean.js",
"clean": "lerna run clean --stream && rimraf coverage",
"postversion": "node ./scripts/postversion/index.js",
"prettier:all": "prettier --write --config ./prettier.config.js \"packages/**/*.{ts,tsx}\""
},
Expand Down
12 changes: 12 additions & 0 deletions packages/base/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cjs
Device
hooks
lib
polyfill
styling
types
utils
LICENSE
NOTICE.txt
index.esm.js
index.d.ts
5 changes: 5 additions & 0 deletions packages/base/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scripts
src
index.ts
rollup.config.js
tsconfig.json
File renamed without changes.
9 changes: 7 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@
"core-js/**/*"
],
"scripts": {
"build:copy-third-party": "ncp src/third-party/ ../../build/node_modules/base/third-party/",
"postbuild": "npm run build:copy-third-party && rollup -c && tsc ./src/polyfill/*.ts --outDir ../../build/node_modules/base/polyfill --skipLibCheck"
"clean": "rimraf cjs Device hooks lib polyfill styling types utils index.esm.js index.d.ts",
"build:rollup": "rollup -c rollup.config.js",
"build:polyfills": "tsc ./src/polyfill/*.ts --outDir ./polyfill --skipLibCheck",
"postbuild": "npm-run-all -s build:rollup build:polyfills"
},
"dependencies": {
"core-js": "3.1.4",
"resize-observer-polyfill": "^1.5.1"
},
"peerDependencies": {
"react": "^16.8.0"
},
"publishConfig": {
"access": "public"
}
}
File renamed without changes.
12 changes: 12 additions & 0 deletions packages/charts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cjs
components
interfaces
internal
lib
themes
util
config.d.ts
index.d.ts
index.esm.js
LICENSE
NOTICE.txt
4 changes: 4 additions & 0 deletions packages/charts/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
index.ts
rollup.config.js
tsconfig.json
File renamed without changes.
7 changes: 5 additions & 2 deletions packages/charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
},
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
"private": false,
"sideEffects": [
"@ui5/webcomponents/dist/Label"
],
"scripts": {
"postbuild": "rollup -c"
"clean": "rimraf cjs components interfaces internal lib themes util index.esm.js index.d.ts",
"postbuild": "rollup -c rollup.config.js"
},
"dependencies": {
"@ui5/webcomponents-react": "0.7.0-rc.1",
Expand All @@ -35,5 +35,8 @@
},
"peerDependencies": {
"react": "^16.8.0"
},
"publishConfig": {
"access": "public"
}
}
2 changes: 2 additions & 0 deletions packages/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LICENSE
NOTICE.txt
1 change: 0 additions & 1 deletion packages/docs/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ SKIP_DOC_GENERATION=true
'@ui5/webcomponents-react/lib': path.join(PATHS.root, 'packages', 'main', 'src', 'lib'),
'@ui5/webcomponents-react-charts/lib': path.join(PATHS.root, 'packages', 'charts', 'src', 'lib'),
'@ui5/webcomponents-react-base/lib': path.join(PATHS.root, 'packages', 'base', 'src', 'lib'),
'@ui5/webcomponents-react-base/third-party': path.join(PATHS.root, 'packages', 'base', 'src', 'third-party'),
'@ui5/webcomponents-react-base/polyfill': path.join(PATHS.root, 'packages', 'base', 'npm', 'polyfill')
};

Expand Down
4 changes: 0 additions & 4 deletions packages/docs/typings.d.ts

This file was deleted.

11 changes: 11 additions & 0 deletions packages/main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cjs
components
enums
interfaces
internal
lib
webComponents
index.d.ts
index.esm.js
LICENSE
NOTICE.txt
5 changes: 5 additions & 0 deletions packages/main/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scripts
src
index.ts
rollup.config.js
tsconfig.json
File renamed without changes.
5 changes: 4 additions & 1 deletion packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
"private": false,
"sideEffects": [
"@ui5/webcomponents-icons/dist/icons/*"
],
"scripts": {
"clean": "rimraf cjs components enums interfaces internal lib webComponents index.esm.js index.d.ts",
"generateWebComponents": "ts-node -O '{\"module\": \"commonjs\"}' -r esm ./scripts/wrapperGeneration/index.js --onlyStopForMerge",
"build": "webpack --config ./scripts/wrapperGeneration/webpack.config.js",
"postbuild": "rollup -c rollup.config.js"
Expand All @@ -40,5 +40,8 @@
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"publishConfig": {
"access": "public"
}
}
18 changes: 7 additions & 11 deletions scripts/ci/release-rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ yarn install --mutex network
# run tests
yarn test

# trigger lerna release
${WORKSPACE}/node_modules/.bin/lerna version prerelease \
--conventional-prerelease \
--create-release github

# 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 --tag next --access public
cd ${WORKSPACE}/build/node_modules/main && npm publish --tag next --access public
cd ${WORKSPACE}/build/node_modules/base && npm publish --tag next --access public
# if we came to that point we are ready for publish

# trigger lerna release
${WORKSPACE}/node_modules/.bin/lerna publish prerelease \
--conventional-prerelease \
--create-release github \
--dist-tag next \
--pre-dist-tag next

# all packages are now released, clear npm-session
rm ~/.npmrc
25 changes: 7 additions & 18 deletions scripts/ci/release-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,11 @@ then
exit 0
fi

CHANGED_PACKAGES=$(git diff-tree --no-commit-id --name-only -r -m ${TRAVIS_COMMIT} | \
grep -e "^packages/" | \
grep -v -e "packages/docs")
# make sure we are on the master branch
git checkout master

echo $CHANGED_PACKAGES

if [ -z "${CHANGED_PACKAGES}" ]
then
echo "No npm relevant packages changed - skip npm release"
exit 0
fi

#git push --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" "$TRAVIS_BRANCH" > /dev/null 2>&1;
#git checkout -b "release/${PACKAGE_VERSION}"
#git push --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" "release/${PACKAGE_VERSION}" > /dev/null 2>&1;

cd ${TRAVIS_BUILD_DIR}/build/node_modules/charts && npm publish --access public --tag dev
cd ${TRAVIS_BUILD_DIR}/build/node_modules/main && npm publish --access public --tag dev
cd ${TRAVIS_BUILD_DIR}/build/node_modules/base && npm publish --access public --tag dev
${TRAVIS_BUILD_DIR}/node_modules/.bin/lerna publish prerelease \
--canary \
--conventional-prerelease \
--dist-tag dev \
--preid dev
2 changes: 2 additions & 0 deletions scripts/ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ git config user.email ${GITHUB_EMAIL}
git config user.name ${GITHUB_USER}
git remote set-url origin "https://${GH_TOKEN}@github.com/SAP/ui5-webcomponents-react.git" > /dev/null 2>&1

export UI5_WEBCOMPONENTS_FOR_REACT_RELEASE_BUILD="true"

# make sure we are on the master branch
git checkout master

Expand Down
19 changes: 0 additions & 19 deletions scripts/ci/version-bump-snapshot.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/clean.js

This file was deleted.

27 changes: 12 additions & 15 deletions scripts/postversion/release-storybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@ const shell = require('shelljs');
const { highlightLog } = require('../utils');

module.exports = new Promise((resolve) => {
if (process.env.FIORI_FOR_REACT_SNAPSHOT_BUILD === 'true') {
resolve();
return;
}

highlightLog('Prepare Storybook');
if (process.env.UI5_WEBCOMPONENTS_FOR_REACT_RELEASE_BUILD === 'true') {
highlightLog('Prepare Storybook');

const storybooksGenerated =
shell.exec('node_modules/.bin/build-storybook -c packages/docs/.storybook -o .out').code === 0;
if (!storybooksGenerated) {
console.error('Generating storybook failed!');
process.exit(1);
}
highlightLog('Deploy Storybook');
const storybooksGenerated =
shell.exec('node_modules/.bin/build-storybook -c packages/docs/.storybook -o .out').code === 0;
if (!storybooksGenerated) {
console.error('Generating storybook failed!');
process.exit(1);
}
highlightLog('Deploy Storybook');

shell.exec('node_modules/.bin/storybook-to-ghpages --ci --existing-output-dir .out');
shell.exec('node_modules/.bin/storybook-to-ghpages --ci --existing-output-dir .out');

highlightLog('Storybooks deployed successfully');
highlightLog('Storybooks deployed successfully');
}
resolve();
});
Loading

0 comments on commit 728756e

Please sign in to comment.