File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,29 @@ jobs:
176
176
--publish ${{ inputs.dry-run && 'never' || 'always' }}
177
177
${{ matrix.os == 'windows-latest' && '--win' || '' }}
178
178
--config.artifactName='${name}-${version}-${arch}-${os}-${buildTime}.${ext}'
179
+ # 添加错误处理逻辑
180
+ on_retry_command : |
181
+ echo "Checking if assets already exist..."
182
+ if [[ $ERROR_OUTPUT == *"already_exists"* ]]; then
183
+ echo "Assets already exist, treating as success"
184
+ exit 0
185
+ fi
186
+ continue_on_error : true # 允许任务继续执行
179
187
env :
180
188
GH_TOKEN : ${{ secrets.GH_TOKEN }}
181
189
BUILD_TIME : ${{ github.run_number }}
182
190
191
+ # 添加验证步骤
192
+ - name : Verify Release Assets
193
+ if : success() || failure() # 即使前一步失败也运行
194
+ run : |
195
+ RELEASE_URL="https://api.github.com/repos/${{ github.repository }}/releases/latest"
196
+ ASSETS=$(curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" $RELEASE_URL)
197
+ if echo "$ASSETS" | grep -q "${BUILD_TIME}"; then
198
+ echo "Release assets verified successfully"
199
+ exit 0
200
+ else
201
+ echo "Release assets verification failed"
202
+ exit 1
203
+ fi
204
+
You can’t perform that action at this time.
0 commit comments