Skip to content

Commit

Permalink
Merge pull request #137 from dnbexperience/develop
Browse files Browse the repository at this point in the history
new release config setup
  • Loading branch information
tujoworker authored Mar 13, 2019
2 parents 32d5ff0 + e008d2e commit 80cdfb4
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ jobs:
- run: yarn test-ci

- run:
name: Prepublish the ui-lib and commit changes
command: yarn prepublish-ci
name: Prebuild the ui-lib and commit changes
command: yarn prebuild-ci

- run:
name: Build the portal, just to test if the build is successful
Expand Down Expand Up @@ -106,8 +106,8 @@ jobs:
- run: yarn test-ci

- run:
name: Prepublish the ui-lib to use it in "build-ci"
command: yarn prepublish-ci
name: Prebuild the ui-lib to use it in "build-ci"
command: yarn prebuild-ci

- run:
name: Build the portal
Expand Down
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:
- yarn install
- yarn lint-ci
- yarn test-ci
- yarn prepublish-ci
- yarn prebuild-ci
- yarn build-ci
- yarn test-ci-screenshots
when:
Expand Down Expand Up @@ -82,7 +82,7 @@ steps:
- yarn install
- yarn lint-ci
- yarn test-ci
- yarn prepublish-ci
- yarn prebuild-ci
- yarn build-ci
- yarn test-ci-screenshots
- yarn deploy-ci
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:

- stage: deploy-preview
name: Build a portal preview
script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prepublish-ci && yarn build-ci && test-ci-screenshots
script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prebuild-ci && yarn build-ci && test-ci-screenshots

- stage: deploy-release
name: Deploy portal and make eventually NPM release
script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prepublish-ci && yarn build-ci && test-ci-screenshots && yarn deploy-ci && yarn publish-ci
script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prebuild-ci && yarn build-ci && test-ci-screenshots && yarn deploy-ci && yarn publish-ci

stages:
- name: test
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"main": "./packages/dnb-ui-lib/index.js",
"scripts": {
"audit-ci": "yarn workspace dnb-ui-lib audit-ci",
"prepublish-ci": "yarn workspace dnb-ui-lib prepublish-ci",
"prebuild-ci": "yarn workspace dnb-ui-lib prebuild-ci",
"precommit": "yarn workspace dnb-ui-lib precommit && yarn workspace dnb-design-system-portal precommit",
"build-ci": "yarn workspace dnb-design-system-portal build-ci",
"deploy-ci": "yarn workspace dnb-design-system-portal deploy-ci",
Expand Down
7 changes: 0 additions & 7 deletions packages/dnb-ui-lib/.releaserc

This file was deleted.

12 changes: 6 additions & 6 deletions packages/dnb-ui-lib/package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ module.exports = {
serve: 'yarn cdn',
cdn: 'yarn cdn',
publish: {
default: 'yarn prepublish:local',
local: 'yarn prepublish:local',
dev: 'yarn prepublish:dev',
update: 'yarn prepublish:update',
release: 'yarn prepublishOnly'
default: 'yarn prebuild:local',
local: 'yarn prebuild:local',
dev: 'yarn prebuild:dev',
update: 'yarn prebuild:update',
release: 'yarn prebuildOnly'
},
generate: {
default: 'yarn build',
dev: 'yarn prepublish:dev'
dev: 'yarn prebuild:dev'
},
figma: {
default: 'yarn figma',
Expand Down
19 changes: 13 additions & 6 deletions packages/dnb-ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"post-build": "yarn prettier:other",
"audit-ci": "npm i && audit-ci --moderate --package-manager=npm --advisories=782",
"audit-ci:yarn": "babel-node ./scripts/prepub/audit/toOpt && audit-ci --moderate --package-manager=yarn --advisories=782 && babel-node ./scripts/prepub/audit/toDev",
"build": "yarn prepublish:local && yarn post-build",
"build": "yarn prebuild:local && yarn post-build",
"prebuild-ci": "yarn figma-ci-build && yarn prebuild:local && yarn test:update && yarn figma-ci-commit",
"prebuild:dev": "nodemon --exec 'babel-node ./scripts/prepub/dev.js' --watch 'rollup.config.js' --ext js,html,json,css,scss --watch './src/style/**/*' --watch './scripts/**/*' --ignore '*.json'",
"prebuild:local": "babel-node ./scripts/prepub/runPrepub.js",
"prebuild:update": "babel-node ./scripts/prepub/updateAndPrepub.js",
"prebuildOnly:disabled": "yarn prebuild:update && jest --ci",
"cdn": "live-server --no-browser --cors --port=8081",
"precommit": "yarn lint-staged",
"dev:convertIcons": "nodemon --exec 'babel-node ./scripts/tools/convertIcons' --ignore '/icons/**' --ignore '*.json'",
Expand All @@ -39,14 +44,9 @@
"lint:styles": "stylelint './src/{components,patterns,style}/**/*.{js,scss}'",
"lint:styles:staged": "stylelint",
"publish": "yarn publish-ci --dry-run",
"prepublish-ci": "yarn figma-ci-build && yarn prepublish:local && yarn test:update && yarn figma-ci-commit",
"publish-ci": "babel-node ./scripts/release --ci",
"prepublish:dev": "nodemon --exec 'babel-node ./scripts/prepub/dev.js' --watch 'rollup.config.js' --ext js,html,json,css,scss --watch './src/style/**/*' --watch './scripts/**/*' --ignore '*.json'",
"publish:disabled": "yarn publish:prerelease && npm publish ./dnb-ui-lib-v*.tgz --preid=ci --npm-tag=ci",
"prepublish:local": "babel-node ./scripts/prepub/runPrepub.js",
"publish:postpack": "yarn pack && nodemon --exec 'babel-node ./scripts/release/postpack.js' ",
"prepublish:update": "babel-node ./scripts/prepub/updateAndPrepub.js",
"prepublishOnly:disabled": "yarn prepublish:update && jest --ci",
"reset": "rm -rf ./node_modules ./components ./elements ./es ./icons ./patterns ./shared ./style ./umd",
"start": "yarn story",
"story": "start-storybook -s / -p 8002 --ci",
Expand Down Expand Up @@ -189,5 +189,12 @@
"svgo": "^1.2.0",
"text-mask-addons": "^3.8.0",
"traverse": "^0.6.6"
},
"release": {
"ci": true,
"debug": false,
"dryRun": false,
"branch": "release",
"analyzeCommits": "simple-commit-message"
}
}
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/scripts/figma/version.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"1a3caba565dddc0a936aaddc29a82887":"115251496"}
{"1a3caba565dddc0a936aaddc29a82887":"115366593"}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('cleanupPackage', () => {
})
const parsedJson = JSON.parse(cleanedPackage)

expect(parsedJson).not.toHaveProperty('release')
expect(parsedJson).not.toHaveProperty('scripts')
expect(parsedJson).not.toHaveProperty('devDependencies')
expect(parsedJson).toHaveProperty('dependencies')
Expand Down
14 changes: 6 additions & 8 deletions packages/dnb-ui-lib/scripts/release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import dotenv from 'dotenv'
import semanticRelease from 'semantic-release'
import { WritableStreamBuffer } from 'stream-buffers'
import prepareForRelease from './prepareForRelease'
import { release } from '../../package.json'

// import .env variables
dotenv.config()
Expand All @@ -17,14 +18,11 @@ const semanicRelease = async () => {

const stdoutBuffer = new WritableStreamBuffer()
const stderrBuffer = new WritableStreamBuffer()
const result = await semanticRelease(
{},
{
// Store stdout and stderr to use later instead of writing to `process.stdout` and `process.stderr`
stdout: stdoutBuffer,
stderr: stderrBuffer
}
)
const result = await semanticRelease(release, {
// Store stdout and stderr to use later instead of writing to `process.stdout` and `process.stderr`
stdout: stdoutBuffer,
stderr: stderrBuffer
})

if (result) {
const { lastRelease, commits, nextRelease, releases } = result
Expand Down
1 change: 1 addition & 0 deletions packages/dnb-ui-lib/scripts/release/prepareForRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const cleanupPackage = ({ packageJsonString, filepath }) =>
new Promise(async (resolve, reject) => {
try {
const packageJson = JSON.parse(packageJsonString)
delete packageJson.release
delete packageJson.scripts
delete packageJson.devDependencies

Expand Down

0 comments on commit 80cdfb4

Please sign in to comment.