Skip to content

Commit ab32f74

Browse files
committed
chore: Enhance release workflow with GoReleaser checks and scoop manifest testing
1 parent 2b000b6 commit ab32f74

File tree

1 file changed

+98
-3
lines changed

1 file changed

+98
-3
lines changed

.github/workflows/release.yml

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,107 @@ jobs:
2525
- name: Verify Chocolatey Installation
2626
run: choco --version
2727

28-
- name: Run GoReleaser
28+
- name: Run GoReleaser (without scoop publishing)
2929
uses: goreleaser/goreleaser-action@v6
3030
with:
3131
distribution: goreleaser
3232
version: "~> v2"
33-
args: release --clean
33+
args: release --clean --skip=chocolatey
3434
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3636
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
37+
38+
- name: Check what GoReleaser created
39+
run: |
40+
echo "📁 Checking dist directory contents..."
41+
if (Test-Path 'dist') {
42+
Write-Host "✅ dist folder exists!"
43+
Get-ChildItem -Path 'dist' -Recurse | Select-Object FullName, Length
44+
} else {
45+
Write-Host "❌ dist folder not found!"
46+
}
47+
48+
echo ""
49+
echo "🔍 Looking for scoop manifest..."
50+
if (Test-Path 'dist/scoop/zed-cli-win-unofficial.json') {
51+
Write-Host "✅ Scoop manifest found!"
52+
Write-Host "📦 Original manifest contents:"
53+
Get-Content 'dist/scoop/zed-cli-win-unofficial.json' | Write-Host
54+
} else {
55+
Write-Host "❌ Scoop manifest not found in expected location"
56+
Write-Host "📁 Checking what's in dist/scoop/:"
57+
if (Test-Path 'dist/scoop') {
58+
Get-ChildItem 'dist/scoop' | Write-Host
59+
} else {
60+
Write-Host "❌ dist/scoop directory doesn't exist"
61+
}
62+
}
63+
shell: powershell
64+
65+
- name: Fix Scoop Manifest (Test - Log Only)
66+
run: |
67+
echo "🔧 Testing scoop manifest fix..."
68+
69+
if (Test-Path 'dist/scoop/zed-cli-win-unofficial.json') {
70+
Write-Host "✅ Found scoop manifest, reading contents..."
71+
$manifest = Get-Content 'dist/scoop/zed-cli-win-unofficial.json' | ConvertFrom-Json
72+
73+
Write-Host "📋 Current bin array:"
74+
$manifest.architecture."64bit".bin | ForEach-Object { Write-Host " - $_" }
75+
76+
# Add zed.bat to bin array
77+
$manifest.architecture."64bit".bin += "zed-cli-win-unofficial/zed.bat"
78+
79+
Write-Host ""
80+
Write-Host "📋 Updated bin array would be:"
81+
$manifest.architecture."64bit".bin | ForEach-Object { Write-Host " - $_" }
82+
83+
# Convert to JSON for preview
84+
$jsonContent = $manifest | ConvertTo-Json -Depth 10
85+
86+
Write-Host ""
87+
Write-Host "📄 Complete updated manifest would be:"
88+
Write-Host $jsonContent
89+
90+
Write-Host ""
91+
Write-Host "✅ Scoop manifest fix test successful!"
92+
93+
# Create bucket directory for testing
94+
if (-not (Test-Path 'bucket')) {
95+
New-Item -ItemType Directory -Path 'bucket'
96+
Write-Host "📁 Created bucket directory (for testing)"
97+
}
98+
99+
# Save the fixed manifest (just for logging, not committing)
100+
$jsonContent | Set-Content 'bucket/zed-cli-win-unofficial.json'
101+
Write-Host "💾 Saved fixed manifest to bucket/ (for testing)"
102+
103+
} else {
104+
Write-Host "❌ Scoop manifest not found"
105+
exit 1
106+
}
107+
shell: powershell
108+
109+
- name: Show what would be committed
110+
run: |
111+
echo "📊 Summary of what would be committed to repository:"
112+
echo ""
113+
114+
if (Test-Path 'bucket/zed-cli-win-unofficial.json') {
115+
Write-Host "✅ bucket/zed-cli-win-unofficial.json"
116+
Write-Host " Size: $((Get-Item 'bucket/zed-cli-win-unofficial.json').Length) bytes"
117+
Write-Host ""
118+
Write-Host "📄 File contents that would be committed:"
119+
Get-Content 'bucket/zed-cli-win-unofficial.json' | Write-Host
120+
} else {
121+
Write-Host "❌ No manifest file to commit"
122+
}
123+
124+
echo ""
125+
Write-Host "🚀 In a real release, this would:"
126+
Write-Host " 1. Create/update bucket/zed-cli-win-unofficial.json"
127+
Write-Host " 2. Commit with message: 'Scoop update for zed-cli-win-unofficial version ${{ github.ref_name }}'"
128+
Write-Host " 3. Push to main branch"
129+
Write-Host ""
130+
Write-Host "ℹ️ To enable actual committing, update the workflow to include git commands"
131+
shell: powershell

0 commit comments

Comments
 (0)