diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0e0a5db --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = tab +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[{package.json,.travis.yml}] +indent_style = space diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..93eef79 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: node_js + +node_js: + - "lts/*" + +cache: npm + +branches: + only: + - master + +after_success: + - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + +deploy: + - provider: script + script: npx semantic-release -r + https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git + skip_cleanup: true + keep_history: true + on: + branch: master diff --git a/README.md b/README.md index c51dfb5..e5f267b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ -# semantic-release-npm-github-config -semantic-release shareable configuration for npm + GitHub +# @jedmao/semantic-release-npm-github-config + +[**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish npm packages with [GitHub](https://github.com). + +[![Travis](https://img.shields.io/travis/jedmao/semantic-release-npm-github-config.svg?style=flat-square)](https://travis-ci.org/jedmao/semantic-release-npm-github-config) +[![npm version](https://img.shields.io/npm/v/@jedmao/semantic-release-npm-github-config/latest.svg?style=flat-square)](https://www.npmjs.com/package/@jedmao/semantic-release-npm-github-config) + +## Plugins + +This shareable configuration use the following plugins: + +- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer) +- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator) +- [`@semantic-release/npm`](https://github.com/semantic-release/npm) +- [`@semantic-release/github`](https://github.com/semantic-release/github) +- [`@semantic-release/git`](https://github.com/semantic-release/git) + +## Install + +```bash +$ npm install --save-dev semantic-release semantic-release-npm-github-config +``` + +## Usage + +The shareable config can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration): + +```json +{ + "extends": "@jedmao/semantic-release-npm-github-config", + "branch": "master" +} +``` + +## Configuration + +See each [plugin](#plugins) documentation for required installation and configuration steps. diff --git a/index.json b/index.json new file mode 100644 index 0000000..2c9bb0f --- /dev/null +++ b/index.json @@ -0,0 +1,30 @@ +{ + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/changelog", + { + "changelogTitle": "Changelog" + } + ], + [ + "@semantic-release/npm", + { + "tarballDir": "dist" + } + ], + [ + "@semantic-release/github", + { + "assets": "dist/*.tgz" + } + ], + [ + "@semantic-release/git", + { + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e0635be --- /dev/null +++ b/package.json @@ -0,0 +1,62 @@ +{ + "name": "@jedmao/semantic-release-npm-github-config", + "version": "1.0.0", + "description": "semantic-release shareable configuration for npm + GitHub", + "main": "index.json", + "files": [ + "index.json" + ], + "scripts": { + "commit": "git-cz", + "test": "xo" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jedmao/semantic-release-npm-github-config.git" + }, + "keywords": [ + "semantic-release", + "semantic-release-config", + "npm", + "github", + "git" + ], + "author": "Jed Mao ", + "license": "MIT", + "bugs": { + "url": "https://github.com/jedmao/semantic-release-npm-github-config/issues" + }, + "homepage": "https://github.com/jedmao/semantic-release-npm-github-config#readme", + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, + "prettier": { + "printWidth": 120, + "trailingComma": "es5" + }, + "xo": { + "prettier": true + }, + "dependencies": { + "@semantic-release/changelog": "^3.0.2", + "@semantic-release/commit-analyzer": "^6.1.0", + "@semantic-release/git": "^7.0.8", + "@semantic-release/github": "^5.2.10", + "@semantic-release/npm": "^5.1.7", + "@semantic-release/release-notes-generator": "^7.1.4" + }, + "peerDependencies": { + "semantic-release": ">=15.13.12 <16.0.0" + }, + "devDependencies": { + "commitizen": "^3.1.1", + "cz-conventional-changelog": "^2.1.0", + "semantic-release": "^15.13.12", + "xo": "^0.24.0" + } +}