@@ -143,6 +143,41 @@ jobs:
143143 "Text2Voice.dmg" \
144144 "dist/"
145145
146+ - name : Zip Artifacts
147+ shell : bash
148+ run : |
149+ echo "Creating zip archive..."
150+ cd dist
151+ if [ "${{ runner.os }}" == "Windows" ]; then
152+ 7z a ../Text2Voice-${{ runner.os }}.zip ./*
153+ elif [ "${{ runner.os }}" == "macOS" ]; then
154+ zip -r ../Text2Voice-${{ runner.os }}.zip ./*
155+ else
156+ zip -r ../Text2Voice-${{ runner.os }}.zip ./*
157+ fi
158+ cd ..
159+ # 重命名文件以匹配下载链接
160+ if [ "${{ runner.os }}" == "Windows" ]; then
161+ mv Text2Voice-Windows.zip Text2Voice-windows-latest.zip
162+ elif [ "${{ runner.os }}" == "macOS" ]; then
163+ mv Text2Voice-macOS.zip Text2Voice-macos-latest.zip
164+ else
165+ mv Text2Voice-Linux.zip Text2Voice-ubuntu-latest.zip
166+ fi
167+ ls -la Text2Voice-*.zip
168+ echo "Zip files created:"
169+ for f in Text2Voice-*.zip; do
170+ echo "- $f ($(stat -f%z "$f" 2>/dev/null || stat -c%s "$f") bytes)"
171+ done
172+
173+ - name : Upload Artifacts
174+ uses : actions/upload-artifact@v4
175+ with :
176+ name : Text2Voice-${{ matrix.os }}
177+ path : Text2Voice-${{ matrix.os }}.zip
178+ compression-level : 9
179+ retention-days : 365
180+
146181 - name : Create Release
147182 if : startsWith(github.ref, 'refs/tags/')
148183 uses : softprops/action-gh-release@v2
@@ -168,33 +203,6 @@ jobs:
168203 
169204 draft : false
170205 prerelease : false
171- files : |
172- Text2Voice-*.zip
206+ files : Text2Voice-*-latest.zip # 更新文件匹配模式
173207 env :
174- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
175-
176- # 确保压缩步骤在 release 之前执行
177- - name : Zip Artifacts
178- shell : bash
179- run : |
180- echo "Creating zip archive..."
181- cd dist
182- if [ "${{ runner.os }}" == "Windows" ]; then
183- 7z a ../Text2Voice-${{ matrix.os }}.zip ./*
184- else
185- zip -r ../Text2Voice-${{ matrix.os }}.zip ./*
186- fi
187- cd ..
188- ls -la Text2Voice-*.zip
189- echo "Zip files created:"
190- for f in Text2Voice-*.zip; do
191- echo "- $f ($(stat -f%z "$f" 2>/dev/null || stat -c%s "$f") bytes)"
192- done
193-
194- - name : Upload Artifacts
195- uses : actions/upload-artifact@v4
196- with :
197- name : Text2Voice-${{ matrix.os }}
198- path : Text2Voice-${{ matrix.os }}.zip
199- compression-level : 9
200- retention-days : 365
208+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments