Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

feat(auto-release): Semantic release #2

Merged
merged 6 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.4.0

version: 2
jobs:
checkout_code:
<<: *defaults
steps:
- checkout
- persist_to_workspace:
root: ~/repo
paths:
- .

test:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install dependencies with npm
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: Compile the files using Babel
command: npm run compile
- persist_to_workspace:
root: ~/repo
paths:
- node_modules
- dist

release:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- checkout
- run:
name: Copy core files to the /dist folder
command: npm run copypackage
- run: npm run semantic-release

workflows:
version: 2
build:
jobs:
- checkout_code
- test:
requires:
- checkout_code
- release:
context: org-global
requires:
- test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
.DS_Store

.docz/**
yarn-error.log
package-lock.json
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"dist": "cd dist && npm publish",
"docz:dev": "docz dev",
"docz:build": "docz build",
"postpublish": "cp -r dist/package.json .",
"semantic-release": "semantic-release",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -29,6 +31,8 @@
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@semantic-release/changelog": "^3.0.2",
"@semantic-release/git": "^7.0.8",
"babel-plugin-styled-components": "^1.8.0",
"docz": "^1.0.4",
"docz-theme-default": "^1.0.4",
Expand All @@ -41,6 +45,7 @@
"prop-types": "^15.7.2",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"semantic-release": "^15.13.12",
"styled-components": "^4.0.1-0"
},
"peerDependencies": {
Expand All @@ -53,5 +58,31 @@
"prop-types": "^15.7.2",
"react-hook-size": "^1.3.0",
"react-popper": "^1.3.3"
},
"release": {
"branch": "master",
"prepare": [
"@semantic-release/changelog",
"@semantic-release/npm",
{
"path": "@semantic-release/git",
"assets": [
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"pkgRoot": "dist"
}
],
"@semantic-release/github"
]
}
}
Loading