Skip to content

Commit 7b9a3dd

Browse files
committed
fix: publish-release should only undraft via gh (avoid duplicate asset uploads)
Made-with: Cursor
1 parent fd83c9c commit 7b9a3dd

1 file changed

Lines changed: 10 additions & 24 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,9 @@ jobs:
153153
env:
154154
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
155155

156-
# Only after Chocolatey succeeds: publish the release and push to Winget + AUR.
157-
# Running GoReleaser again (no --draft, skip=chocolatey) publishes the draft and runs Winget + AUR.
156+
# Only after Chocolatey succeeds: publish the release (make it public).
158157
publish-release:
159-
name: Publish release and push to Winget/AUR
158+
name: Publish release
160159
runs-on: ubuntu-latest
161160
needs: [release, chocolatey]
162161
permissions:
@@ -167,25 +166,12 @@ jobs:
167166
uses: actions/checkout@v4
168167
with:
169168
fetch-depth: 0
170-
171-
- name: Set up Go
172-
uses: actions/setup-go@v5
173-
with:
174-
go-version: "1.24.4"
175-
176-
- name: Install go-winres (for Windows icon embedding)
177-
run: go install github.com/tc-hib/go-winres@latest
178-
179-
# Publish the release (undraft) and push to Winget + AUR. Chocolatey already done on Windows.
180-
- name: Run GoReleaser (publish + Winget + AUR)
181-
uses: goreleaser/goreleaser-action@v6
182-
with:
183-
distribution: goreleaser
184-
version: '~> v2'
185-
args: release --clean --skip=chocolatey
169+
- name: Install GitHub CLI
170+
run: |
171+
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
172+
curl -fsSL https://cli.github.com/packages/setup-apt-repo | sudo -E bash -
173+
sudo apt install gh -y
174+
- name: Publish draft release
175+
run: gh release edit "${{ github.ref_name }}" --draft=false
186176
env:
187-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188-
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
189-
SCOOP_BUCKET_TOKEN: ${{ secrets.SCOOP_BUCKET_TOKEN }}
190-
WINGET_PR_TOKEN: ${{ secrets.WINGET_PR_TOKEN }}
191-
AUR_PRIVATE_KEY: ${{ secrets.AUR_PRIVATE_KEY }}
177+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)