Skip to content

Commit 88f273f

Browse files
committed
fix: improve release asset upload reliability
- Split upload step into Unix and Windows variants - Add file existence checks before upload - Use || true for Unix to prevent failures from stopping the workflow - Add debug output to show which files are being uploaded - This should fix intermittent upload failures
1 parent 7f7d801 commit 88f273f

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,39 @@ jobs:
164164
cd target/${{ matrix.target }}/release/
165165
(Get-FileHash -Algorithm SHA256 ${{ matrix.artifact_name }}).Hash + " " + "${{ matrix.artifact_name }}" | Out-File -Encoding ASCII ${{ matrix.asset_name }}.sha256
166166
167-
- name: Upload Release Asset
167+
- name: Upload Release Asset (Unix)
168+
if: matrix.os != 'windows-latest'
169+
env:
170+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171+
run: |
172+
cd target/${{ matrix.target }}/release/
173+
# Upload binary
174+
if [ -f "${{ matrix.artifact_name }}" ]; then
175+
echo "Uploading ${{ matrix.artifact_name }}..."
176+
gh release upload ${{ github.ref_name }} "${{ matrix.artifact_name }}" --clobber || true
177+
fi
178+
# Upload checksum
179+
if [ -f "${{ matrix.asset_name }}.sha256" ]; then
180+
echo "Uploading ${{ matrix.asset_name }}.sha256..."
181+
gh release upload ${{ github.ref_name }} "${{ matrix.asset_name }}.sha256" --clobber || true
182+
fi
183+
184+
- name: Upload Release Asset (Windows)
185+
if: matrix.os == 'windows-latest'
168186
env:
169187
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170188
run: |
171189
cd target/${{ matrix.target }}/release/
172-
gh release upload ${{ github.ref_name }} ${{ matrix.artifact_name }} ${{ matrix.asset_name }}.sha256 --clobber
190+
# Upload binary
191+
if (Test-Path "${{ matrix.artifact_name }}") {
192+
Write-Host "Uploading ${{ matrix.artifact_name }}..."
193+
gh release upload ${{ github.ref_name }} "${{ matrix.artifact_name }}" --clobber
194+
}
195+
# Upload checksum
196+
if (Test-Path "${{ matrix.asset_name }}.sha256") {
197+
Write-Host "Uploading ${{ matrix.asset_name }}.sha256..."
198+
gh release upload ${{ github.ref_name }} "${{ matrix.asset_name }}.sha256" --clobber
199+
}
173200
174201
build-docker:
175202
name: Build and Push Docker Image

0 commit comments

Comments
 (0)