Skip to content
This repository was archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
feat: initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewLeedham committed Jun 19, 2019
1 parent 391b404 commit 89fa598
Show file tree
Hide file tree
Showing 8 changed files with 6,257 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: 2

defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.14.1
resource_class: small

jobs:
install_lint:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- node-10-cache-{{ checksum "./yarn.lock" }}
- run: yarn install
- run: yarn lint
- save_cache:
key: node-10-cache-{{ checksum "./yarn.lock" }}
paths:
- ~/.yarn-cache
- ./node_modules
- persist_to_workspace:
root: ~/repo
paths:
- ./

deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Configure git
command: |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
git config --global user.email "jenkinsbuilder@documentsmart.com"
git config --global user.name "xeroxinteractive-builder"
- run:
name: Deploy package to npm
command: yarn deploy

workflows:
version: 2
install_lint_deploy:
jobs:
- install_lint
- deploy:
requires:
- install_lint
filters:
branches:
only:
- master
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"EditorConfig.editorconfig"
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"search.exclude": {
"node_modules/**/*": true
},
"files.eol": "\n",
"editor.tabSize": 2,
"editor.detectIndentation": false,
"[javascript]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"[yaml]": {
"editor.formatOnSave": true
}
}
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# semantic-release-config-xerox

> semantic-release shareable config for Xerox projects
[![circleci status][circleci-badge]][circleci-link]
[![npm package][npm-badge]][npm-link]
[![license MIT][license-badge]][license]
[![commit style angular][commit-style-badge]][commit-style-link]
[![semantic-release][semantic-release-badge]][semantic-release-link]

## Usage
1. Install this config and eslint as a `devDependency`:
```bash
yarn add semantic-release semantic-release-config-xerox --dev
# or
npm install semantic-release semantic-release-config-xerox --save-dev
```
2. Extend the base and any additional configs in your semantic release configuration:
```json
{
"extends": "semantic-release-config-xerox/npm"
}
```

## Configurations
### npm
Uses the following plugins:
* [@semantic-release/plugin-commit-analyzer](https://github.com/semantic-release/commit-analyzer)
* [@semantic-release/plugin-release-notes-generator](https://github.com/semantic-release/release-notes-generator)
* [@semantic-release/plugin-changelog](https://github.com/semantic-release/changelog)
* [@semantic-release/plugin-npm](https://github.com/semantic-release/npm)
* [@semantic-release/plugin-git](https://github.com/semantic-release/git)
* [@semantic-release/plugin-github](https://github.com/semantic-release/github)
* [@semantic-release-slack-bot](https://github.com/juliuscc/semantic-release-slack-bot/)

These plugins require the following environment variables:
* `NPM_TOKEN`: so semantic-release can publish to npm.
* `GH_TOKEN`: so semantic-release can comment on PRs and create releases.


---

[LICENSE][license] | [CHANGELOG][changelog] | [ISSUES][issues]

[license]: ./LICENSE
[changelog]: ./CHANGELOG.md
[issues]: https://github.com/xeroxinteractive/semantic-release-config-xerox/issues

[circleci-badge]: https://flat.badgen.net/circleci/github/xeroxinteractive/semantic-release-config-xerox/master
[circleci-link]: https://circleci.com/gh/xeroxinteractive/semantic-release-config-xerox/tree/master

[npm-badge]: https://flat.badgen.net/npm/v/semantic-release-config-xerox?color=cyan
[npm-link]: https://www.npmjs.com/package/semantic-release-config-xerox

[license-badge]: https://flat.badgen.net/npm/license/semantic-release-config-xerox

[commit-style-badge]: https://flat.badgen.net/badge/commit%20style/angular/purple
[commit-style-link]: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines
[semantic-release-badge]: https://flat.badgen.net/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80/semantic%20release/e10079
[semantic-release-link]: https://github.com/semantic-release/semantic-release
40 changes: 40 additions & 0 deletions npm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
plugins: [
[
'@semantic-release/commit-analyzer',
{
releaseRules: [
{
type: 'refactor',
release: 'patch'
}
]
}
],
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
'@semantic-release/git',
'@semantic-release/github',
[
'semantic-release-slack-bot',
{
notifyOnSuccess: true,
notifyOnFail: false,
onSuccessTemplate: {
attachments: [
{
title:
':rocket: A new version of to <$repo_url|$package_name> was just published.',
text:
'Version $npm_package_number, triggered by ' +
process.env.CIRCLE_USERNAME,
color: 'good',
attachment_type: 'default'
}
]
}
}
]
]
};
62 changes: 62 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "semantic-release-config-xerox",
"version": "0.0.0",
"description": "semantic-release shareable config for Xerox projects",
"repository": "git@github.com:xeroxinteractive/semantic-release-config-xerox.git",
"homepage": "https://github.com/xeroxinteractive/semantic-release-config-xerox#readme",
"author": "Andrew Leedham <Andrew.Leedham@xerox.com>",
"license": "MIT",
"files": [
"npm.js"
],
"scripts": {
"lint": "eslint .",
"format": "eslint . --fix",
"deploy": "semantic-release"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint --env HUSKY_GIT_PARAMS"
}
},
"eslintConfig": {
"extends": [
"xerox"
]
},
"prettier": {
"tabWidth": 2,
"singleQuote": true,
"arrowParens": "always",
"endOfLine": "lf"
},
"release": {
"extends": "./npm"
},
"dependencies": {
"@semantic-release/changelog": "^3.0.2",
"@semantic-release/commit-analyzer": "^6.1.0",
"@semantic-release/git": "^3.1.0",
"@semantic-release/github": "^5.4.0",
"@semantic-release/npm": "^5.1.1",
"@semantic-release/release-notes-generator": "^7.1.4",
"semantic-release-slack-bot": "^1.1.0"
},
"peerDependencies": {
"semantic-release": "*"
},
"devDependencies": {
"@commitlint/cli": "^8.0.0",
"@commitlint/config-conventional": "^8.0.0",
"eslint": "^5.16.0",
"eslint-config-xerox": "^1.4.2",
"husky": "^2.4.1",
"prettier": "^1.18.2",
"semantic-release": "^15.13.16"
}
}
Loading

0 comments on commit 89fa598

Please sign in to comment.