Skip to content

Commit

Permalink
fix(deploy): added release script
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Jan 15, 2024
1 parent 8eb9828 commit 8cf79d0
Show file tree
Hide file tree
Showing 24 changed files with 3,691 additions and 2,255 deletions.
15 changes: 15 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"rules": {
"indent": 0,
"no-await-in-loop": 0,
"require-atomic-updates": 0
},
"globals": {
"BigInt": true
},
"extends": ["nodemailer", "prettier"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "script"
}
}
79 changes: 0 additions & 79 deletions .eslintrc.js

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
branches:
- master

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

name: release
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: ${{vars.NPM_MODULE_NAME}}
pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
- uses: actions/checkout@v3
# 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@v3
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 }}
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'
};
6 changes: 3 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app.disable('x-powered-by');
* in a situation where we consume a flash messages but then comes a redirect
* and the message is never displayed
*/
hbs.registerHelper('flash_messages', function() {
hbs.registerHelper('flash_messages', function () {
if (typeof this.flash !== 'function') {
return '';
}
Expand Down Expand Up @@ -78,14 +78,14 @@ hbs.registerHelper('flash_messages', function() {
return new hbs.handlebars.SafeString(response.join('\n'));
});

hbs.registerHelper('num', function(options) {
hbs.registerHelper('num', function (options) {
// eslint-disable-line prefer-arrow-callback
return new hbs.handlebars.SafeString(
humanize.numberFormat(options.fn(this), 0, ',', ' ') // eslint-disable-line no-invalid-this
);
});

hbs.registerHelper('dec', function(options) {
hbs.registerHelper('dec', function (options) {
// eslint-disable-line prefer-arrow-callback
return new hbs.handlebars.SafeString(
humanize.numberFormat(options.fn(this), 3, ',', ' ') // eslint-disable-line no-invalid-this
Expand Down
2 changes: 1 addition & 1 deletion lib/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function fetchCounters(zones, callback) {
});

top.forEach(entry => {
entry.share = total ? entry.messages / total * 100 : 0;
entry.share = total ? (entry.messages / total) * 100 : 0;
});

callback(null, zones, top, totals);
Expand Down
Loading

0 comments on commit 8cf79d0

Please sign in to comment.