Skip to content

Commit

Permalink
feat: automatic release process
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Sep 19, 2024
1 parent 65d9670 commit a92527e
Show file tree
Hide file tree
Showing 17 changed files with 5,772 additions and 5,758 deletions.
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"rules": {
"indent": 0,
"no-await-in-loop": 0,
"require-atomic-updates": 0
},
"globals": {
"BigInt": true
},
"extends": ["nodemailer", "prettier"],
"parserOptions": {
"ecmaVersion": 2020
}
}
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write
id-token: write

name: release
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/[email protected]
id: release
with:
release-type: node

# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run tests

on:
push:
pull_request:

jobs:
test:
strategy:
matrix:
node: [20.x, 22.x]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm install
- name: Run tests
run: npm test
18 changes: 1 addition & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

npm-debug.log
node_modules
.DS_Store

events/*.js
.DS_Store
19 changes: 0 additions & 19 deletions .jshintrc

This file was deleted.

10 changes: 10 additions & 0 deletions .ncurc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
upgrade: true,
reject: [
// Block package upgrades that moved to ESM
'chai',
// API changes in newer eslint versions
'grunt-eslint',
'eslint'
]
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@postalsys:registry=https://registry.npmjs.org/
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
printWidth: 160,
tabWidth: 4,
singleQuote: true,
endOfLine: 'lf',
trailingComma: 'none',
arrowParens: 'avoid'
};
16 changes: 6 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
'use strict';

module.exports = function(grunt) {

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: ['lib/*.js', 'test/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc'
}
eslint: {
all: ['lib/*.js', 'test/*.js', 'Gruntfile.js']
},

mochaTest: {
Expand All @@ -22,9 +18,9 @@ module.exports = function(grunt) {
});

// Load the plugin(s)
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-mocha-test');

// Tasks
grunt.registerTask('default', ['jshint', 'mochaTest']);
};
grunt.registerTask('default', ['eslint', 'mochaTest']);
};
Loading

0 comments on commit a92527e

Please sign in to comment.