Skip to content

Commit

Permalink
ci: added publish package, commit hooks, update package versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Manzhula committed Nov 11, 2024
1 parent 4dfeb90 commit 0d4e7d1
Show file tree
Hide file tree
Showing 15 changed files with 8,707 additions and 956 deletions.
2 changes: 2 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
members: false
8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches:
- master
tags-ignore:
- "**"
pull_request:
branches:
- "**"

jobs:
build:
name: Build
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- if: github.event_name == 'pull_request'
name: Lint commit messages
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- run: npm test
publish:
name: "Publish"
needs: build
runs-on: ubuntu-latest
environment: npm_publish
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- run: npm ci
- name: Publish new version
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
22 changes: 0 additions & 22 deletions .github/workflows/test.yml

This file was deleted.

67 changes: 65 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
.nyc_output
/.idea

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# my own test-results folder
test-results

# Coverage directory used by tools like istanbul
coverage
node_modules

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing

## Commit messages

Your commit messages ideally can answer two questions: what changed and why. The subject line should feature the “what” and the body of the commit should describe the “why”.
Commit format must follow [Conventional Commits
spec](https://www.conventionalcommits.org/en/v1.0.0/)
6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @type {import('@commitlint/types').UserConfig}
*/
module.exports = {
extends: ['@commitlint/config-conventional'],
};
20 changes: 20 additions & 0 deletions nyc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
'check-coverage': true,
lines: 90,
statements: 90,
functions: 90,
branches: 90,
watermarks: {
lines: [85, 100],
functions: [85, 100],
branches: [85, 100],
statements: [85, 100],
},
include: ['**/*.js'],
exclude: ['node_modules', 'test-results', 'test/*', '**/*.spec.js', '*.config.js'],
reporter: ['text', 'html', 'cobertura'],
cache: false,
all: true,
'temp-directory': './test-results/coverage/.tmp',
'report-dir': './test-results/coverage',
};
Loading

0 comments on commit 0d4e7d1

Please sign in to comment.