@@ -31,12 +31,54 @@ jobs:
3131
3232 - name : package
3333 run : jpackage --name https-proxy --input target/universal/stage/lib --main-jar https-proxy.https-proxy-${{ inputs.version }}.jar --main-class Main --type app-image
34- - name : release
35- # 上传 https-proxy 目录
34+ - name : Archive macOS app bundle
35+ if : matrix.os == 'macos-latest'
36+ run : |
37+ EXPECTED_APP_DIR="https-proxy.app"
38+ ARCHIVE_NAME="https-proxy-macos-${{ inputs.version }}.zip"
39+ if [ -d "$EXPECTED_APP_DIR" ]; then
40+ zip -r "$ARCHIVE_NAME" "$EXPECTED_APP_DIR"
41+ echo "macOS artifact zipped to $ARCHIVE_NAME"
42+ else
43+ echo "Error: $EXPECTED_APP_DIR not found in current directory. Listing contents:"
44+ ls -lah
45+ # Attempt to find it if jpackage placed it inside 'https-proxy' folder
46+ if [ -d "https-proxy/$EXPECTED_APP_DIR" ]; then
47+ echo "Found $EXPECTED_APP_DIR inside 'https-proxy' directory. Zipping from there."
48+ (cd https-proxy && zip -r "../$ARCHIVE_NAME" "$EXPECTED_APP_DIR")
49+ echo "macOS artifact zipped to $ARCHIVE_NAME from https-proxy/$EXPECTED_APP_DIR"
50+ else
51+ echo "Still cannot find $EXPECTED_APP_DIR. Exiting."
52+ exit 1
53+ fi
54+ fi
55+
56+ - name : Debug macOS jpackage output
57+ if : matrix.os == 'macos-latest'
58+ run : |
59+ pwd
60+ echo "--- Listing current directory ---"
61+ ls -lah
62+ echo "--- Listing target/universal/stage ---"
63+ ls -lah target/universal/stage
64+ echo "--- Listing expected jpackage output location (if it's a directory) ---"
65+ ls -lah https-proxy || echo "Directory https-proxy not found or ls failed"
66+ echo "--- Check if https-proxy.app exists ---"
67+ ls -lah *.app || echo "No .app files found in current directory"
68+ - name : Upload macOS artifact
69+ if : matrix.os == 'macos-latest'
70+ uses : actions/upload-artifact@v4
71+ with :
72+ name : https-proxy-${{ replace(matrix.os, '-latest', '') }}-${{ inputs.version }}
73+ path : https-proxy-macos-${{ inputs.version }}.zip
74+ if-no-files-found : error
75+ - name : Upload Linux/Windows artifact
76+ if : matrix.os != 'macos-latest'
3677 uses : actions/upload-artifact@v4
3778 with :
38- name : https-proxy-${{ matrix.os }}-${{ inputs.version }}
39- path : https-proxy
40- if-no-files-found : error
79+ name : https-proxy-${{ replace(matrix.os, '-latest', '') }}-${{ inputs.version }}
80+ path : https-prox
81+ if-no-files-found : error
82+
4183
4284
0 commit comments