Skip to content

Commit 64592c7

Browse files
committed
fix(infra): add commitlint and use semantic release
1 parent 6246b5a commit 64592c7

File tree

7 files changed

+770
-39
lines changed

7 files changed

+770
-39
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v1
11+
- uses: actions/checkout@v3
1212
- name: Use Node.js 18
1313
uses: actions/setup-node@v3
1414
with:

.github/workflows/npmpublish.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,33 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v1
12+
- uses: actions/checkout@v3
13+
1314
- uses: actions/setup-node@v3
1415
with:
1516
node-version: 18
1617
- run: yarn install --immutable
18+
- run: yarn build
1719
- run: yarn lint
1820
- run: yarn test
19-
- run: yarn build
21+
2022

2123
publish-npm:
2224
needs: build
2325
runs-on: ubuntu-latest
2426
steps:
2527
- uses: actions/checkout@v1
28+
2629
- uses: actions/setup-node@v3
2730
with:
2831
node-version: 18
2932
registry-url: https://registry.npmjs.org/
3033
- run: yarn install --immutable
3134
- run: yarn build
32-
- run: npm publish --access public
33-
env:
34-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
3535

36+
- name: Release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
run: |
41+
yarn dlx semantic-release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tsconfig.build.json
2828
jest.config.js
2929
.prettierrc.js
3030
.eslintrc.js
31+
.commitlintrc.json

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
@gasbuddy/service
2-
=================
1+
# @openapi-typescript-infra/service
32

4-
[![Node CI](https://github.com/openapi-typescript-infra/openapi-typescript-service/actions/workflows/nodejs.yml/badge.svg)](https://github.com/openapi-typescript-infra/openapi-typescript-service/actions/workflows/nodejs.yml)
3+
[![Node CI](https://github.com/openapi-typescript-infra/service/actions/workflows/nodejs.yml/badge.svg)](https://github.com/openapi-typescript-infra/service/actions/workflows/nodejs.yml)
54

65
An opinionated framework for building high scale services - web, api, or job. Uses OpenAPI, pino, express, confit, Typescript and jest.
76

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openapi-typescript-infra/service",
3-
"version": "1.0.0",
3+
"version": "0.0.0",
44
"description": "An opinionated framework for building configuration driven services - web, api, or job. Uses OpenAPI, pino logging, express, confit, Typescript and Jest.",
55
"main": "build/index.js",
66
"scripts": {
@@ -82,15 +82,17 @@
8282
"shortstop-yaml": "^1.0.0"
8383
},
8484
"devDependencies": {
85-
"@openapi-typescript-infra/coconfig": "^1.0.0",
85+
"@commitlint/cli": "^17.6.3",
86+
"@commitlint/config-conventional": "^17.6.3",
87+
"@openapi-typescript-infra/coconfig": "^3.0.1",
8688
"@types/cookie-parser": "^1.4.3",
8789
"@types/eventsource": "1.1.11",
8890
"@types/express": "^4.17.17",
8991
"@types/glob": "^8.1.0",
9092
"@types/jest": "^29.5.1",
91-
"@types/lodash": "^4.14.194",
93+
"@types/lodash": "^4.14.195",
9294
"@types/minimist": "^1.2.2",
93-
"@types/node": "^18.16.14",
95+
"@types/node": "^18.16.15",
9496
"@types/supertest": "^2.0.12",
9597
"coconfig": "^0.10.1",
9698
"eslint": "^8.41.0",

0 commit comments

Comments
 (0)