Skip to content

Commit

Permalink
feat: add semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed May 1, 2024
1 parent f89d7c5 commit 16eb340
Show file tree
Hide file tree
Showing 5 changed files with 3,426 additions and 49 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Linting

on: [push]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn
- run: yarn lint
42 changes: 42 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Push
concurrency:
group: push
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Build
run: yarn build

- name: Install latest npm
run: npm install -g npm@latest

- name: Release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
run: yarn release
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Run tests

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 12.x, 14.x, 16.x ]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: "yarn"
- run: yarn
- run: yarn test
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "Default serverless middleware for some of our projects.",
"main": "src/index.js",
"scripts": {
"test": "jest"
"test": "jest",
"lint": "prettier --check .",
"release": "semantic-release"
},
"repository": {
"type": "git",
Expand All @@ -25,6 +27,7 @@
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"lambda-sample-events": "^1.0.1",
"prettier": "^3.2.5"
"prettier": "^3.2.5",
"semantic-release": "^23.0.8"
}
}
Loading

0 comments on commit 16eb340

Please sign in to comment.