@capgo/cli 4.10.38 → 4.10.39
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/check_posix_paths.yml +87 -25
- package/CHANGELOG.md +7 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/test/VerifyZip.java +35 -0
|
@@ -9,6 +9,36 @@ on:
|
|
|
9
9
|
- main
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
+
create-valid-zip-linux:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v3
|
|
18
|
+
|
|
19
|
+
- name: Setup bun
|
|
20
|
+
uses: oven-sh/setup-bun@v1.2.2
|
|
21
|
+
with:
|
|
22
|
+
bun-version: latest
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
id: install_code
|
|
26
|
+
run: bun install --frozen-lockfile
|
|
27
|
+
|
|
28
|
+
- name: Build code
|
|
29
|
+
id: build_code
|
|
30
|
+
run: bun run build
|
|
31
|
+
|
|
32
|
+
- name: Create a valid zip test
|
|
33
|
+
id: create_zip
|
|
34
|
+
run: node ./dist/index.js bundle zip --path test/test_upload -n build-linux.zip
|
|
35
|
+
|
|
36
|
+
- name: Upload build-linux.zip artifact
|
|
37
|
+
uses: actions/upload-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: build-zip-linux
|
|
40
|
+
path: build-linux.zip
|
|
41
|
+
|
|
12
42
|
check-posix-paths-windows:
|
|
13
43
|
runs-on: ${{ matrix.os }}
|
|
14
44
|
|
|
@@ -45,9 +75,52 @@ jobs:
|
|
|
45
75
|
|
|
46
76
|
check-posix-paths-unix:
|
|
47
77
|
runs-on: ubuntu-latest
|
|
48
|
-
needs: check-posix-paths-windows
|
|
78
|
+
needs: [create-valid-zip-linux, check-posix-paths-windows]
|
|
49
79
|
|
|
50
80
|
steps:
|
|
81
|
+
- name: Download build-linux.zip artifact
|
|
82
|
+
uses: actions/download-artifact@v4
|
|
83
|
+
with:
|
|
84
|
+
name: build-zip-linux
|
|
85
|
+
path: build-linux.zip
|
|
86
|
+
|
|
87
|
+
- name: Check file size of Linux build
|
|
88
|
+
run: ls -lh build-linux.zip
|
|
89
|
+
|
|
90
|
+
- name: Verify ZIP file integrity for Linux build with zipinfo
|
|
91
|
+
run: |
|
|
92
|
+
echo "Verifying ZIP file integrity for Linux build with zipinfo..."
|
|
93
|
+
zipinfo build-linux.zip || (echo "ZIP file is corrupted: build-linux.zip" && exit 1)
|
|
94
|
+
|
|
95
|
+
- name: Setup Java
|
|
96
|
+
uses: actions/setup-java@v3
|
|
97
|
+
with:
|
|
98
|
+
distribution: 'adopt'
|
|
99
|
+
java-version: '11'
|
|
100
|
+
|
|
101
|
+
- name: Compile VerifyZip.java
|
|
102
|
+
run: javac VerifyZip.java
|
|
103
|
+
|
|
104
|
+
- name: Verify ZIP file integrity for Linux build with Java
|
|
105
|
+
run: java VerifyZip build-linux.zip
|
|
106
|
+
|
|
107
|
+
- name: Verify POSIX paths for Linux build
|
|
108
|
+
run: |
|
|
109
|
+
unzip build-linux.zip -d extracted-linux
|
|
110
|
+
error_found=false
|
|
111
|
+
find extracted-linux -type f | while read -r file; do
|
|
112
|
+
if [[ "$file" =~ "\\" ]]; then
|
|
113
|
+
echo "Non-POSIX path detected: $file"
|
|
114
|
+
error_found=true
|
|
115
|
+
fi
|
|
116
|
+
done
|
|
117
|
+
if [ "$error_found" = true ]; then
|
|
118
|
+
echo "Non-POSIX paths detected in the zip file (Linux)"
|
|
119
|
+
exit 1
|
|
120
|
+
else
|
|
121
|
+
echo "All paths are POSIX compliant in build-linux.zip."
|
|
122
|
+
fi
|
|
123
|
+
|
|
51
124
|
- name: Download build-windows-2019.zip artifact
|
|
52
125
|
uses: actions/download-artifact@v4
|
|
53
126
|
with:
|
|
@@ -60,25 +133,31 @@ jobs:
|
|
|
60
133
|
name: build-zip-windows-2022
|
|
61
134
|
path: build-windows-2022.zip
|
|
62
135
|
|
|
63
|
-
- name: Check file sizes
|
|
136
|
+
- name: Check file sizes of Windows builds
|
|
64
137
|
run: |
|
|
65
138
|
echo "Checking file sizes..."
|
|
66
|
-
ls -lh
|
|
67
|
-
ls -lh
|
|
139
|
+
ls -lh build-windows-2019.zip
|
|
140
|
+
ls -lh build-windows-2022.zip
|
|
68
141
|
|
|
69
142
|
- name: Verify ZIP file integrity for Windows 2019 build with zipinfo
|
|
70
143
|
run: |
|
|
71
144
|
echo "Verifying ZIP file integrity for Windows 2019 build with zipinfo..."
|
|
72
|
-
zipinfo
|
|
145
|
+
zipinfo build-windows-2019.zip || (echo "ZIP file is corrupted: build-windows-2019.zip" && exit 1)
|
|
73
146
|
|
|
74
147
|
- name: Verify ZIP file integrity for Windows 2022 build with zipinfo
|
|
75
148
|
run: |
|
|
76
149
|
echo "Verifying ZIP file integrity for Windows 2022 build with zipinfo..."
|
|
77
|
-
zipinfo
|
|
150
|
+
zipinfo build-windows-2022.zip || (echo "ZIP file is corrupted: build-windows-2022.zip" && exit 1)
|
|
151
|
+
|
|
152
|
+
- name: Verify ZIP file integrity for Windows 2019 build with Java
|
|
153
|
+
run: java VerifyZip build-windows-2019.zip
|
|
154
|
+
|
|
155
|
+
- name: Verify ZIP file integrity for Windows 2022 build with Java
|
|
156
|
+
run: java VerifyZip build-windows-2022.zip
|
|
78
157
|
|
|
79
158
|
- name: Verify POSIX paths for Windows 2019 build
|
|
80
159
|
run: |
|
|
81
|
-
unzip
|
|
160
|
+
unzip build-windows-2019.zip -d extracted-2019
|
|
82
161
|
error_found=false
|
|
83
162
|
find extracted-2019 -type f | while read -r file; do
|
|
84
163
|
if [[ "$file" =~ "\\" ]]; then
|
|
@@ -95,7 +174,7 @@ jobs:
|
|
|
95
174
|
|
|
96
175
|
- name: Verify POSIX paths for Windows 2022 build
|
|
97
176
|
run: |
|
|
98
|
-
unzip
|
|
177
|
+
unzip build-windows-2022.zip -d extracted-2022
|
|
99
178
|
error_found=false
|
|
100
179
|
find extracted-2022 -type f | while read -r file; do
|
|
101
180
|
if [[ "$file" =~ "\\" ]]; then
|
|
@@ -109,20 +188,3 @@ jobs:
|
|
|
109
188
|
else
|
|
110
189
|
echo "All paths are POSIX compliant in build-windows-2022.zip."
|
|
111
190
|
fi
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
- name: Setup Java
|
|
115
|
-
uses: actions/setup-java@v3
|
|
116
|
-
with:
|
|
117
|
-
distribution: 'adopt'
|
|
118
|
-
java-version: '11'
|
|
119
|
-
|
|
120
|
-
- name: Compile VerifyZip.java
|
|
121
|
-
run: javac test/VerifyZip.java
|
|
122
|
-
|
|
123
|
-
- name: Verify ZIP file integrity for Windows 2019 build with Java
|
|
124
|
-
run: java VerifyZip /home/runner/work/CLI/CLI/build-windows-2019.zip
|
|
125
|
-
|
|
126
|
-
- name: Verify ZIP file integrity for Windows 2022 build with Java
|
|
127
|
-
run: java VerifyZip /home/runner/work/CLI/CLI/build-windows-2022.zip
|
|
128
|
-
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [4.10.39](https://github.com/Cap-go/CLI/compare/v4.10.38...v4.10.39) (2024-06-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add missing java file and control test linux ([bcb0141](https://github.com/Cap-go/CLI/commit/bcb0141eda8e6fe9c607285fbb9a23f7421a5a1b))
|
|
11
|
+
|
|
5
12
|
### [4.10.38](https://github.com/Cap-go/CLI/compare/v4.10.37...v4.10.38) (2024-06-21)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.js
CHANGED
|
@@ -112906,7 +112906,7 @@ var {
|
|
|
112906
112906
|
// package.json
|
|
112907
112907
|
var package_default = {
|
|
112908
112908
|
name: "@capgo/cli",
|
|
112909
|
-
version: "4.10.
|
|
112909
|
+
version: "4.10.39",
|
|
112910
112910
|
description: "A CLI to upload to capgo servers",
|
|
112911
112911
|
author: "github.com/riderx",
|
|
112912
112912
|
license: "Apache 2.0",
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import java.io.File;
|
|
2
|
+
import java.io.FileInputStream;
|
|
3
|
+
import java.io.IOException;
|
|
4
|
+
import java.util.zip.ZipEntry;
|
|
5
|
+
import java.util.zip.ZipInputStream;
|
|
6
|
+
|
|
7
|
+
public class VerifyZip {
|
|
8
|
+
public static void main(String[] args) {
|
|
9
|
+
if (args.length < 1) {
|
|
10
|
+
System.out.println("Usage: java VerifyZip <zip-file>");
|
|
11
|
+
System.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
String zipFilePath = args[0];
|
|
15
|
+
File file = new File(zipFilePath);
|
|
16
|
+
|
|
17
|
+
if (!file.exists()) {
|
|
18
|
+
System.out.println("File not found: " + zipFilePath);
|
|
19
|
+
System.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(file))) {
|
|
23
|
+
ZipEntry entry;
|
|
24
|
+
while ((entry = zis.getNextEntry()) != null) {
|
|
25
|
+
System.out.println("Extracting: " + entry.getName());
|
|
26
|
+
zis.closeEntry();
|
|
27
|
+
}
|
|
28
|
+
System.out.println("ZIP file is valid: " + zipFilePath);
|
|
29
|
+
} catch (IOException e) {
|
|
30
|
+
System.out.println("Failed to process ZIP file: " + zipFilePath);
|
|
31
|
+
e.printStackTrace();
|
|
32
|
+
System.exit(1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|