@capgo/cli 4.10.38 → 4.10.40

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.
@@ -9,6 +9,46 @@ 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: Check build directory contents
37
+ run: |
38
+ echo "Listing contents of the build directory..."
39
+ ls -R ./dist
40
+
41
+ - name: Check ZIP file contents
42
+ run: |
43
+ echo "Listing contents of the ZIP file..."
44
+ unzip -l build-linux.zip
45
+
46
+ - name: Upload build-linux.zip artifact
47
+ uses: actions/upload-artifact@v4
48
+ with:
49
+ name: build-zip-linux
50
+ path: build-linux.zip
51
+
12
52
  check-posix-paths-windows:
13
53
  runs-on: ${{ matrix.os }}
14
54
 
@@ -45,9 +85,52 @@ jobs:
45
85
 
46
86
  check-posix-paths-unix:
47
87
  runs-on: ubuntu-latest
48
- needs: check-posix-paths-windows
88
+ needs: [create-valid-zip-linux, check-posix-paths-windows]
49
89
 
50
90
  steps:
91
+ - name: Download build-linux.zip artifact
92
+ uses: actions/download-artifact@v4
93
+ with:
94
+ name: build-zip-linux
95
+ path: build-linux.zip
96
+
97
+ - name: Check file size of Linux build
98
+ run: ls -lh build-linux.zip
99
+
100
+ - name: Verify ZIP file integrity for Linux build with zipinfo
101
+ run: |
102
+ echo "Verifying ZIP file integrity for Linux build with zipinfo..."
103
+ zipinfo build-linux.zip || (echo "ZIP file is corrupted: build-linux.zip" && exit 1)
104
+
105
+ - name: Setup Java
106
+ uses: actions/setup-java@v3
107
+ with:
108
+ distribution: 'adopt'
109
+ java-version: '11'
110
+
111
+ - name: Compile VerifyZip.java
112
+ run: javac VerifyZip.java
113
+
114
+ - name: Verify ZIP file integrity for Linux build with Java
115
+ run: java VerifyZip build-linux.zip
116
+
117
+ - name: Verify POSIX paths for Linux build
118
+ run: |
119
+ unzip build-linux.zip -d extracted-linux
120
+ error_found=false
121
+ find extracted-linux -type f | while read -r file; do
122
+ if [[ "$file" =~ "\\" ]]; then
123
+ echo "Non-POSIX path detected: $file"
124
+ error_found=true
125
+ fi
126
+ done
127
+ if [ "$error_found" = true ]; then
128
+ echo "Non-POSIX paths detected in the zip file (Linux)"
129
+ exit 1
130
+ else
131
+ echo "All paths are POSIX compliant in build-linux.zip."
132
+ fi
133
+
51
134
  - name: Download build-windows-2019.zip artifact
52
135
  uses: actions/download-artifact@v4
53
136
  with:
@@ -60,25 +143,31 @@ jobs:
60
143
  name: build-zip-windows-2022
61
144
  path: build-windows-2022.zip
62
145
 
63
- - name: Check file sizes
146
+ - name: Check file sizes of Windows builds
64
147
  run: |
65
148
  echo "Checking file sizes..."
66
- ls -lh /home/runner/work/CLI/CLI/build-windows-2019.zip
67
- ls -lh /home/runner/work/CLI/CLI/build-windows-2022.zip
149
+ ls -lh build-windows-2019.zip
150
+ ls -lh build-windows-2022.zip
68
151
 
69
152
  - name: Verify ZIP file integrity for Windows 2019 build with zipinfo
70
153
  run: |
71
154
  echo "Verifying ZIP file integrity for Windows 2019 build with zipinfo..."
72
- zipinfo /home/runner/work/CLI/CLI/build-windows-2019.zip || (echo "ZIP file is corrupted: build-windows-2019.zip" && exit 1)
155
+ zipinfo build-windows-2019.zip || (echo "ZIP file is corrupted: build-windows-2019.zip" && exit 1)
73
156
 
74
157
  - name: Verify ZIP file integrity for Windows 2022 build with zipinfo
75
158
  run: |
76
159
  echo "Verifying ZIP file integrity for Windows 2022 build with zipinfo..."
77
- zipinfo /home/runner/work/CLI/CLI/build-windows-2022.zip || (echo "ZIP file is corrupted: build-windows-2022.zip" && exit 1)
160
+ zipinfo build-windows-2022.zip || (echo "ZIP file is corrupted: build-windows-2022.zip" && exit 1)
161
+
162
+ - name: Verify ZIP file integrity for Windows 2019 build with Java
163
+ run: java VerifyZip build-windows-2019.zip
164
+
165
+ - name: Verify ZIP file integrity for Windows 2022 build with Java
166
+ run: java VerifyZip build-windows-2022.zip
78
167
 
79
168
  - name: Verify POSIX paths for Windows 2019 build
80
169
  run: |
81
- unzip /home/runner/work/CLI/CLI/build-windows-2019.zip -d extracted-2019
170
+ unzip build-windows-2019.zip -d extracted-2019
82
171
  error_found=false
83
172
  find extracted-2019 -type f | while read -r file; do
84
173
  if [[ "$file" =~ "\\" ]]; then
@@ -95,7 +184,7 @@ jobs:
95
184
 
96
185
  - name: Verify POSIX paths for Windows 2022 build
97
186
  run: |
98
- unzip /home/runner/work/CLI/CLI/build-windows-2022.zip -d extracted-2022
187
+ unzip build-windows-2022.zip -d extracted-2022
99
188
  error_found=false
100
189
  find extracted-2022 -type f | while read -r file; do
101
190
  if [[ "$file" =~ "\\" ]]; then
@@ -109,20 +198,3 @@ jobs:
109
198
  else
110
199
  echo "All paths are POSIX compliant in build-windows-2022.zip."
111
200
  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,20 @@
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.40](https://github.com/Cap-go/CLI/compare/v4.10.39...v4.10.40) (2024-06-21)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * better test ([0bf19ce](https://github.com/Cap-go/CLI/commit/0bf19ce088c6c97ed0bdca8c277b1c973c493645))
11
+
12
+ ### [4.10.39](https://github.com/Cap-go/CLI/compare/v4.10.38...v4.10.39) (2024-06-21)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * add missing java file and control test linux ([bcb0141](https://github.com/Cap-go/CLI/commit/bcb0141eda8e6fe9c607285fbb9a23f7421a5a1b))
18
+
5
19
  ### [4.10.38](https://github.com/Cap-go/CLI/compare/v4.10.37...v4.10.38) (2024-06-21)
6
20
 
7
21
 
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.38",
112909
+ version: "4.10.40",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
- "version": "4.10.38",
3
+ "version": "4.10.40",
4
4
  "description": "A CLI to upload to capgo servers",
5
5
  "author": "github.com/riderx",
6
6
  "license": "Apache 2.0",
@@ -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
+ }