Skip to content

Commit d59e138

Browse files
committed
SEMANTIC-RELEASE - Add semantic release
1 parent 9a6548c commit d59e138

File tree

9 files changed

+28969
-5457
lines changed

9 files changed

+28969
-5457
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
on:
22
push:
3-
# Sequence of patterns matched against refs/tags
4-
tags:
5-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
3+
branches:
4+
- main
5+
6+
name: Release
67

78
jobs:
89
npm:
910
runs-on: ubuntu-latest
1011
steps:
12+
- id: auth
13+
uses: jnwng/github-app-installation-token-action@v2
14+
with:
15+
appId: ${{ secrets.GITHUB_APP_ID }}
16+
installationId: ${{ secrets.GITHUB_APP_INSTALLATION_ID }}
17+
privateKey: ${{ secrets.ORG_PRIVATE_KEY }}
1118
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
ref: main
1222
- uses: actions/setup-node@v2
1323
with:
1424
node-version: '12.x'
1525
registry-url: 'https://registry.npmjs.org'
16-
- run: npm install
26+
- run: npm run install
1727
- run: npm run build
18-
- run: npm run build-cli
19-
- run: npm publish
28+
- run: npm run semantic-release
2029
env:
21-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
GH_TOKEN: ${{ steps.auth.outputs.token }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/validation.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,48 @@
11
name: Validation
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
types: [edited, opened, synchronize, reopened]
46

57
jobs:
6-
lint:
7-
name: Linting
8+
commitlint:
9+
name: Linting PR Title / Commit messages
810
runs-on: ubuntu-latest
911
steps:
10-
- uses: actions/checkout@master
11-
- name: Use Node.js 12.x
12-
uses: actions/setup-node@v2
12+
- id: auth
13+
uses: jnwng/github-app-installation-token-action@v2
1314
with:
14-
node-version: 12.x
15-
- name: Install dependencies
15+
appId: ${{ secrets.GITHUB_APP_ID }}
16+
installationId: ${{ secrets.GITHUB_APP_INSTALLATION_ID }}
17+
privateKey: ${{ secrets.ORG_PRIVATE_KEY }}
18+
- uses: amannn/[email protected]
19+
with:
20+
validateSingleCommit: true
21+
env:
22+
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}
23+
24+
lint:
25+
name: Lint
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
- name: Install Packages
1631
run: npm install
17-
- name: ESLint
32+
- name: Lint
1833
run: npm run lint
34+
35+
typecheck:
36+
name: TypeScript Check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v2
41+
- name: Install Packages
42+
run: npm install
43+
- name: Type Check
44+
run: npm run typecheck
45+
1946
test:
2047
name: Run unit tests
2148
runs-on: ubuntu-latest

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
# Sourcing husky helper script that consumes .huskyrc config and allows for debug parameters.
4+
. "$(dirname "$0")/_/husky.sh"
5+
6+
# Hook actions below
7+
npx commitlint --edit $1

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
# Sourcing husky helper script that consumes .huskyrc config and allows for debug parameters.
4+
. "$(dirname "$0")/_/husky.sh"
5+
6+
# Hook actions below
7+
npx lint-staged

.husky/prepare-commit-msg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env sh
2+
3+
# Sourcing husky helper script that consumes .huskyrc config and allows for debug parameters.
4+
. "$(dirname "$0")/_/husky.sh"
5+
6+
# Hook actions below, in this case we utilize git-cz, which fallsback to regular `git commit`
7+
# if for whatever reason commitizen is not installed. /dev/tty is used to ensure that commitizen
8+
# can get user input.
9+
exec < /dev/tty && npx git-cz --hook || true

0 commit comments

Comments
 (0)