@mu1147-legend/cf-speed-test 1.0.3 → 1.0.4
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/npm-publish.yml +43 -0
- package/index.js +4 -1
- package/package.json +4 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: npm auto publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
publish:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: "20"
|
|
23
|
+
registry-url: "https://registry.npmjs.org"
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm ci
|
|
27
|
+
|
|
28
|
+
- name: Check commit message
|
|
29
|
+
id: check_commit
|
|
30
|
+
run: |
|
|
31
|
+
commit_msg="${{ github.event.head_commit.message }}"
|
|
32
|
+
echo "Commit message: $commit_msg"
|
|
33
|
+
if [[ "$commit_msg" == *"release"* ]]; then
|
|
34
|
+
echo "has_release=true" >> $GITHUB_OUTPUT
|
|
35
|
+
else
|
|
36
|
+
echo "has_release=false" >> $GITHUB_OUTPUT
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
- name: Publish to npm
|
|
40
|
+
if: steps.check_commit.outputs.has_release == 'true'
|
|
41
|
+
run: npm publish
|
|
42
|
+
env:
|
|
43
|
+
npm_config_provenance: true
|
package/index.js
CHANGED
|
@@ -49,7 +49,9 @@ async function run() {
|
|
|
49
49
|
controller.signal,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
+
console.log("");
|
|
52
53
|
console.log(chalk.blue(`✔ Download: ${dl.toFixed(2)} Mbps`));
|
|
54
|
+
console.log("");
|
|
53
55
|
|
|
54
56
|
// 🔥 upload with glowing animation
|
|
55
57
|
const ul = await uploadTest(
|
|
@@ -58,8 +60,9 @@ async function run() {
|
|
|
58
60
|
CONNECTIONS,
|
|
59
61
|
controller.signal,
|
|
60
62
|
);
|
|
61
|
-
|
|
63
|
+
console.log("");
|
|
62
64
|
console.log(chalk.magenta(`✔ Upload: ${ul.toFixed(2)} Mbps`));
|
|
65
|
+
console.log("");
|
|
63
66
|
|
|
64
67
|
dlArr.push(dl);
|
|
65
68
|
ulArr.push(ul);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@mu1147-legend/cf-speed-test",
|
|
3
3
|
"author": "Muhammad Ullah",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"description": "CLI Speed Test Tool (Download, Upload, Ping, Jitter)",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"speedtest",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"upload",
|
|
14
14
|
"ping",
|
|
15
15
|
"jitter",
|
|
16
|
-
"netspeed"
|
|
16
|
+
"netspeed",
|
|
17
|
+
"cf-speed-test",
|
|
18
|
+
"cloudflare"
|
|
17
19
|
],
|
|
18
20
|
"type": "module",
|
|
19
21
|
"bin": {
|