Skip to content

Commit 598e3c0

Browse files
author
Constantin Krüger
committed
Build: setup release process and dependabot (fixes #3)
- use eslint - use semantic release process
1 parent 65b6c69 commit 598e3c0

File tree

12 files changed

+10445
-1
lines changed

12 files changed

+10445
-1
lines changed

.eslintrc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
env:
2+
browser: true
3+
commonjs: true
4+
es2021: true
5+
extends: standard
6+
parserOptions:
7+
ecmaVersion: latest
8+
ignorePatterns: []
9+
rules: {}

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 2
9+
commit-message:
10+
prefix: Upgrade
11+
prefix-development: Build

.github/workflows/ci.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os:
16+
- ubuntu-latest
17+
- windows-latest
18+
node-version:
19+
- 18.x
20+
- 20.x
21+
runs-on: ${{ matrix.os }}
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up NodeJs ${{ matrix.node-version }}
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: ~/.npm
33+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
34+
restore-keys: |
35+
${{ runner.os }}-node-
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Lint
41+
run: npm run lint
42+
43+
- name: test
44+
run: npm test

.github/workflows/release.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow release a new semantic version of npm package
2+
# For more information see: https://github.com/semantic-release/semantic-release/blob/2b94bb4e0967c705ab92deace342f9fecb02909d/docs/recipes/ci-configurations/github-actions.md
3+
4+
name: Release
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: write # to be able to publish a GitHub release
17+
issues: write # to be able to comment on released issues
18+
pull-requests: write # to be able to comment on released pull requests
19+
id-token: write # to enable use of OIDC for npm provenance
20+
21+
steps:
22+
- name: Checkout 🛎️
23+
uses: actions/checkout@v3
24+
- name: Set up NodeJs ${{ matrix.node-version }}
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 20.x
28+
- name: Install Dependencies 🚧
29+
run: npm ci
30+
- name: Build Package 🛠
31+
run: npm pack
32+
- name: Release 🚀
33+
run: npm run release --debug
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
node_modules/
3+
reports/
4+
.lfet/tool

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org/
2+
cat -

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
[
6+
"@semantic-release/changelog",
7+
{
8+
"changelogFile": "CHANGELOG.md"
9+
}
10+
],
11+
"@semantic-release/github",
12+
"@semantic-release/npm",
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["CHANGELOG.md", "package.json", "package-lock.json"]
17+
}
18+
]
19+
],
20+
"preset": "eslint",
21+
"branches": ["main"]
22+
}

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
# htmlSanityCheck.js
1+
# htmlSanityCheck.js
2+
3+
[![Build status](https://github.com/uniqueck/htmlSanityCheck.js/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/uniqueck/htmlSanityCheck.js/actions/workflows/ci.yaml)
4+
[![npm version](http://img.shields.io/npm/v/htmlSanityCheck.js.svg)](https://www.npmjs.com/package/htmlSanityCheck.js)

lib/index.js

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

0 commit comments

Comments
 (0)