diff --git a/.circleci/config.yml b/.circleci/config.yml index 923e9de93570a9dd21caef4b3c88cfd1928d17d5..430dc9ddd63aaad8b0a1248ff1cf4b8b67b2fda0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,10 +72,9 @@ jobs: - node_modules key: v1-dependencies-{{ checksum "package.json" }} - - run: BUILD_TAG=$(./node_modules/.bin/npm-snapshot $CIRCLE_BUILD_NUM) echo 'export BUILD_TAG=$BUILD_TAG' >> $BASH_ENV - run: - name: Publish Snapshot - command: npm publish --access public + name: Publish Release + command: npm run semantic-release workflows: version: 2 diff --git a/.releaserc.js b/.releaserc.js new file mode 100644 index 0000000000000000000000000000000000000000..414a7689c4d2180fe3c1abc799e679334a89951f --- /dev/null +++ b/.releaserc.js @@ -0,0 +1,12 @@ +module.exports = { + plugins: [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + ["@semantic-release/github", {}], + ["@semantic-release/changelog", { + "changelogFile": "CHANGELOG.md", + }], + "@semantic-release/git", + "@semantic-release/npm", + ] +}; \ No newline at end of file diff --git a/package.json b/package.json index fc333e765907e7bbc03d0543c8878c9d836448cd..33f9d9708abc5bf59646b8f4c0d20f8fda7b4246 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "jsonschema2md": "./cli.js" }, "scripts": { + "semantic-release": "semantic-release", + "commit": "git-cz", "lint": "eslint .", "lint-fix": "eslint . --fix", "start": "node cli.js", @@ -28,11 +30,19 @@ "winston": "^3.1.0" }, "devDependencies": { + "@semantic-release/changelog": "^3.0.2", + "@semantic-release/git": "^7.0.8", + "@semantic-release/github": "^5.2.10", + "commitizen": "^3.0.7", + "cz-conventional-changelog": "^2.1.0", "eslint": "^5.6.1", + "ghooks": "^2.0.4", "istanbul": "^0.4.5", "jasmine": "~3.3.0", "jasmine-diff": "^0.1.3", - "npm-snapshot": "^1.0.3" + "lint-staged": "^8.1.5", + "npm-snapshot": "^1.0.3", + "semantic-release": "^15.13.3" }, "engines": { "node": ">= 6.0.0" @@ -45,5 +55,16 @@ "url": "https://github.com/adobe/jsonschema2md/issues" }, "license": "Apache-2.0", - "author": "" + "author": "", + "lint-staged": { + "*.js": "eslint" + }, + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + }, + "ghooks": { + "pre-commit": "npx lint-staged" + } + } }