Skip to content

Commit 8cf79d0

Browse files
committed
fix(deploy): added release script
1 parent 8eb9828 commit 8cf79d0

24 files changed

+3691
-2255
lines changed

.eslintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"rules": {
3+
"indent": 0,
4+
"no-await-in-loop": 0,
5+
"require-atomic-updates": 0
6+
},
7+
"globals": {
8+
"BigInt": true
9+
},
10+
"extends": ["nodemailer", "prettier"],
11+
"parserOptions": {
12+
"ecmaVersion": 2018,
13+
"sourceType": "script"
14+
}
15+
}

.eslintrc.js

-79
This file was deleted.

.github/workflows/release.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
id-token: write
10+
11+
name: release
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v3
17+
id: release
18+
with:
19+
release-type: node
20+
package-name: ${{vars.NPM_MODULE_NAME}}
21+
pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
22+
- uses: actions/checkout@v3
23+
# these if statements ensure that a publication only occurs when
24+
# a new release is created:
25+
if: ${{ steps.release.outputs.release_created }}
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 20
29+
registry-url: 'https://registry.npmjs.org'
30+
if: ${{ steps.release.outputs.release_created }}
31+
- run: npm ci
32+
if: ${{ steps.release.outputs.release_created }}

.prettierrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
printWidth: 160,
3+
tabWidth: 4,
4+
singleQuote: true,
5+
endOfLine: 'lf',
6+
trailingComma: 'none',
7+
arrowParens: 'avoid'
8+
};

app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ app.disable('x-powered-by');
3939
* in a situation where we consume a flash messages but then comes a redirect
4040
* and the message is never displayed
4141
*/
42-
hbs.registerHelper('flash_messages', function() {
42+
hbs.registerHelper('flash_messages', function () {
4343
if (typeof this.flash !== 'function') {
4444
return '';
4545
}
@@ -78,14 +78,14 @@ hbs.registerHelper('flash_messages', function() {
7878
return new hbs.handlebars.SafeString(response.join('\n'));
7979
});
8080

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

88-
hbs.registerHelper('dec', function(options) {
88+
hbs.registerHelper('dec', function (options) {
8989
// eslint-disable-line prefer-arrow-callback
9090
return new hbs.handlebars.SafeString(
9191
humanize.numberFormat(options.fn(this), 3, ',', ' ') // eslint-disable-line no-invalid-this

lib/handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function fetchCounters(zones, callback) {
9797
});
9898

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

103103
callback(null, zones, top, totals);

0 commit comments

Comments
 (0)