Skip to content

Commit 16eb340

Browse files
committed
feat: add semantic release
1 parent f89d7c5 commit 16eb340

File tree

5 files changed

+3426
-49
lines changed

5 files changed

+3426
-49
lines changed

.github/workflows/lint.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Linting
2+
3+
on: [push]
4+
5+
jobs:
6+
eslint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Setup node
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: 20
14+
cache: yarn
15+
- run: yarn
16+
- run: yarn lint

.github/workflows/push.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Push
2+
concurrency:
3+
group: push
4+
on:
5+
push:
6+
branches:
7+
- master
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
issues: write
14+
pull-requests: write
15+
id-token: write
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
22+
- name: Setup node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: yarn
27+
28+
- name: Install dependencies
29+
run: yarn --frozen-lockfile
30+
31+
- name: Build
32+
run: yarn build
33+
34+
- name: Install latest npm
35+
run: npm install -g npm@latest
36+
37+
- name: Release
38+
env:
39+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
40+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
41+
NPM_CONFIG_PROVENANCE: true
42+
run: yarn release

.github/workflows/test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
name: Run tests
22

3-
on: [ push, pull_request ]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
77
runs-on: ubuntu-latest
88

99
strategy:
1010
matrix:
11-
node-version: [ 12.x, 14.x, 16.x ]
11+
node-version: [16.x, 18.x, 20.x]
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
- name: Use Node ${{ matrix.node-version }}
16-
uses: actions/setup-node@v2
16+
uses: actions/setup-node@v4
1717
with:
1818
node-version: ${{ matrix.node-version }}
19-
cache: 'yarn'
19+
cache: "yarn"
2020
- run: yarn
2121
- run: yarn test

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "Default serverless middleware for some of our projects.",
55
"main": "src/index.js",
66
"scripts": {
7-
"test": "jest"
7+
"test": "jest",
8+
"lint": "prettier --check .",
9+
"release": "semantic-release"
810
},
911
"repository": {
1012
"type": "git",
@@ -25,6 +27,7 @@
2527
"@types/jest": "^29.5.12",
2628
"jest": "^29.7.0",
2729
"lambda-sample-events": "^1.0.1",
28-
"prettier": "^3.2.5"
30+
"prettier": "^3.2.5",
31+
"semantic-release": "^23.0.8"
2932
}
3033
}

0 commit comments

Comments
 (0)