Skip to content

Commit

Permalink
build: introduce conventional-commits and semantic-release (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
develohpanda authored Oct 9, 2020
1 parent 7a25f42 commit 5a02919
Show file tree
Hide file tree
Showing 9 changed files with 693 additions and 134 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
dist
coverage
jest.config.js
jest.config.js
commitlint.config.js
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test
on:
push:
branches:
- master
pull_request:
types: [ assigned, opened, synchronize, reopened, labeled ]
jobs:
node:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: node --version
- run: yarn install
- run: yarn lint
- run: yarn test:ci
- run: yarn compile
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Commit Messages
on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Wait for ci to succeed
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: ci
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Do something with a failing build
if: steps.wait-for-build.outputs.conclusion == 'failure'
run: |
echo CI failed, exiting release
exit 0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: yarn install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
111 changes: 0 additions & 111 deletions azure-pipelines.yml

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-order",
"version": "1.1.0",
"version": "0.0.0-development",
"description": "Control the order of properties in JSON via a lookup object - including nested properties.",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand All @@ -9,7 +9,7 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/develohpanda/json-order.git"
"url": "https://github.com/develohpanda/json-order.git"
},
"bugs": {
"url": "https://github.com/develohpanda/json-order/issues"
Expand All @@ -19,10 +19,11 @@
"test": "jest",
"test:cover": "jest --coverage",
"test:watch": "jest --watch",
"test:ci": "jest --ci --reporters=jest-junit --coverage --coverageReporters=cobertura",
"test:ci": "jest --ci --coverage",
"compile": "tsc",
"lint": "eslint **/*.{t,j}s",
"lint:fix": "yarn lint --fix"
"lint:fix": "yarn lint --fix",
"semantic-release": "semantic-release"
},
"lint-staged": {
"*.{{t,j}s{,x}}": [
Expand All @@ -32,7 +33,8 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"keywords": [
Expand All @@ -43,6 +45,9 @@
"author": "Opender Singh",
"license": "MIT",
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@types/babel__core": "^7.1.10",
"@types/jest": "^26.0.3",
"@types/lodash.clonedeep": "^4.5.6",
"@typescript-eslint/eslint-plugin": "^2.12.0",
Expand All @@ -59,7 +64,8 @@
"prettier": "^1.19.1",
"ts-jest": "^25.0.0",
"tslint": "^6.0.0",
"typescript": "3.9.7"
"typescript": "3.9.7",
"semantic-release": "^17.1.2"
},
"dependencies": {
"lodash.clonedeep": "^4.5.0"
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
],
"exclude": [
"node_modules",
"jest.config.js"
"jest.config.js",
"commitlint.config.js"
]
}
}
Loading

0 comments on commit 5a02919

Please sign in to comment.