Skip to content

Commit cb9b134

Browse files
author
Test User
committed
fix: add cleanup steps to prevent tar extraction and asset conflicts
- Clean dist folder before build to avoid stale files - Clean Go toolchain cache to prevent tar extraction errors - Remove toolchain modules from both /Users/Dorgham and /home/runner paths - Prevents 'File exists' errors during tar extraction - Ensures clean state before GoReleaser runs This addresses: - Tar extraction errors with existing files - Stale dist files that could cause upload conflicts - Go toolchain cache conflicts during extraction
1 parent 63e5abd commit cb9b134

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ jobs:
2626
with:
2727
go-version: '1.21'
2828

29+
- name: Clean dist folder
30+
run: |
31+
echo "Cleaning dist folder to avoid stale files..."
32+
rm -rf dist/* dist/.* 2>/dev/null || true
33+
echo "✅ Dist folder cleaned"
34+
35+
- name: Clean Go toolchain cache
36+
run: |
37+
echo "Cleaning Go toolchain modules to avoid tar extraction conflicts..."
38+
rm -rf $HOME/go/pkg/mod/golang.org/toolchain@* 2>/dev/null || true
39+
rm -rf /home/runner/go/pkg/mod/golang.org/toolchain@* 2>/dev/null || true
40+
echo "✅ Go toolchain cache cleaned"
41+
2942
- name: Delete existing release (if re-running)
3043
run: |
3144
set -e

0 commit comments

Comments
 (0)