Skip to content

Commit

Permalink
feature: add commit linting, semantic-release, deploy to npm and gh_p…
Browse files Browse the repository at this point in the history
…ages
  • Loading branch information
Brandon Webb authored and Brandon Webb committed Sep 15, 2021
1 parent 58df459 commit 066c48f
Show file tree
Hide file tree
Showing 8 changed files with 29,144 additions and 18,366 deletions.
87 changes: 71 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,76 @@
version: 2
version: 2.1
orbs:
node: circleci/node@4.7
jobs:

build:
working_directory: ~/react-image-magnify
branches:
ignore:
- gh-pages
docker:
- image: circleci/node:15
docker:
- image: node:current-buster-slim
environment:
NODE_ENV: development
steps:
- checkout
- run:
name: install-npm
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
- node/install-packages
- run: npm run build
- persist_to_workspace:
root: .
paths:
- ./node_modules
- run:
name: test
command: npm run test:ci
- dist

release:
docker:
- image: node:current-buster-slim
environment:
NODE_ENV: development
steps:
- attach_workspace:
at: .
- checkout
- node/install-packages
- run: npx semantic-release
- run: npm run deploy-storybook -- --ci

test:
docker:
- image: node:current-buster-slim
environment:
NODE_ENV: development
steps:
- checkout
- node/install-packages
- node/test:
run-command: test:ci

workflows:
version: 2
test and release:
jobs:
- test:
filters:
branches:
only:
- master
- build:
requires:
- test
filters:
branches:
only:
- master

- release:
context:
- Access Tokens
requires:
- build
filters:
branches:
only:
- master

test and build:
jobs:
- test
- build:
requires:
- test
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

npx commitlint --edit $1
18 changes: 18 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**/__mocks__
**/coverage
**/jest
**/src
**/jest.config*
**/junit.xml
**/tsconfig.*
**/webpack.config.*
**/.commitlintrc*
**/.codeclimate.yml
**/.eslintignore
**/.eslintrc*
**/.husky
**/.releaserc*
**/.gitattributes
**/.gitignore
**/.circleci
**/.storybook
19 changes: 19 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
"branches": ["master"],
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "conventionalcommits",
}],
["@semantic-release/release-notes-generator", {
"preset": "conventionalcommits",
}],
"@semantic-release/changelog",
["@semantic-release/npm", {
"tarballDir": "release",
}],
// ["@semantic-release/gitlab", {
// "gitlabUrl": "https://gitlab.com/vistaprint-org/design-technology/themes",
// "assets": "release/*.tgz",
// }],
],
};
Loading

0 comments on commit 066c48f

Please sign in to comment.