Skip to content

Commit fd4d769

Browse files
committed
ci: fix tag fetch, create release before build
1 parent 480c937 commit fd4d769

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ jobs:
7777
OPENCODE_BUMP: ${{ inputs.bump }}
7878
OPENCODE_VERSION: ${{ inputs.version }}
7979

80+
# ── GitHub Release ────────────────────────────────────────
81+
- name: Create GitHub Release
82+
continue-on-error: true
83+
run: |
84+
gh release create "v${{ steps.version.outputs.version }}" \
85+
--draft \
86+
--title "v${{ steps.version.outputs.version }}" \
87+
--repo "${{ github.repository }}" \
88+
--notes "Release v${{ steps.version.outputs.version }}"
89+
env:
90+
GH_TOKEN: ${{ github.token }}
91+
8092
# ── Build CLI binary ───────────────────────────────────────
8193
- name: Build CLI
8294
id: build

script/publish.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ async function prepareReleaseFiles() {
3636
}
3737

3838
if (Script.release && !Script.preview) {
39-
await $`git fetch origin --tags`
39+
// --force ensures local tags are overwritten by remote (avoids "would clobber existing tag")
40+
await $`git fetch origin --tags --force`
4041
await $`git switch --detach`
4142
}
4243

0 commit comments

Comments
 (0)