@canmingir/link-express 1.6.7 → 1.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +54 -7
- package/package.json +1 -1
- package/src/metrics/dbMetrics.js +5 -5
- package/src/postgres.js +1 -1
|
@@ -1,9 +1,56 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Publish NPM Package
|
|
2
|
+
|
|
2
3
|
on:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version_type:
|
|
7
|
+
description: 'Version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
default: 'patch'
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
release:
|
|
16
|
+
types: [created]
|
|
17
|
+
|
|
6
18
|
jobs:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
publish:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: write
|
|
23
|
+
id-token: write
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout code
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
token: ${{ secrets.PAT_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Setup Node.js
|
|
32
|
+
uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: '20'
|
|
35
|
+
registry-url: 'https://registry.npmjs.org'
|
|
36
|
+
|
|
37
|
+
- name: Configure Git
|
|
38
|
+
run: |
|
|
39
|
+
git config user.name "github-actions[bot]"
|
|
40
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: npm ci
|
|
44
|
+
|
|
45
|
+
- name: Bump version
|
|
46
|
+
id: version_bump
|
|
47
|
+
run: |
|
|
48
|
+
npm version ${{ github.event.inputs.version_type }} -m "Bump version to %s [skip ci]"
|
|
49
|
+
git push --follow-tags
|
|
50
|
+
|
|
51
|
+
- name: Publish to NPM
|
|
52
|
+
id: npm_publish
|
|
53
|
+
run: npm publish --access public
|
|
54
|
+
env:
|
|
55
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
56
|
+
|
package/package.json
CHANGED
package/src/metrics/dbMetrics.js
CHANGED
|
@@ -43,12 +43,12 @@ class DBMetrics {
|
|
|
43
43
|
return this.dbWriteLatency.startTimer();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
startPushgateway(
|
|
46
|
+
startPushgateway(metrics = {}) {
|
|
47
47
|
this.pushgatewayConfig = {
|
|
48
|
-
url:
|
|
49
|
-
jobName:
|
|
50
|
-
instance:
|
|
51
|
-
interval:
|
|
48
|
+
url: metrics.url || "http://localhost:9091",
|
|
49
|
+
jobName: metrics.pushGateway.jobName || "api",
|
|
50
|
+
instance: metrics.pushGateway.instance || "database",
|
|
51
|
+
interval: metrics.interval || 15000,
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
this.stopPushgateway();
|
package/src/postgres.js
CHANGED