mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
fix(release): keep manual desktop releases as drafts
Make workflow_dispatch draft handling explicit and add a post-publish guard that edits the release back to draft when manual draft runs upload assets to an existing release.\n\nTested: bun test scripts/pr/release-workflow.test.ts\nTested: git diff --check\nScope-risk: narrow\nConfidence: high
This commit is contained in:
parent
2c1af7a843
commit
ad33980c40
8
.github/workflows/release-desktop.yml
vendored
8
.github/workflows/release-desktop.yml
vendored
@ -587,7 +587,7 @@ jobs:
|
||||
tag_name: v${{ steps.version.outputs.value }}
|
||||
name: Claude Code Haha v${{ steps.version.outputs.value }}
|
||||
body: ${{ steps.release_notes.outputs.body }}
|
||||
draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft || false }}
|
||||
draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft == true }}
|
||||
prerelease: false
|
||||
fail_on_unmatched_files: true
|
||||
files: |
|
||||
@ -599,3 +599,9 @@ jobs:
|
||||
artifacts/release-assets/**/*.blockmap
|
||||
artifacts/update-metadata-standard/*.yml
|
||||
desktop/scripts/install-macos-unsigned.sh
|
||||
|
||||
- name: Ensure workflow-dispatch release remains draft
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.draft == true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: gh release edit "v${{ steps.version.outputs.value }}" --draft --repo "${{ github.repository }}"
|
||||
|
||||
@ -285,6 +285,10 @@ describe('release desktop workflow', () => {
|
||||
expect(publishJob).toContain('artifacts/release-assets/**/*.blockmap')
|
||||
expect(publishJob).toContain('artifacts/update-metadata-standard/*.yml')
|
||||
expect(publishJob).toContain('desktop/scripts/install-macos-unsigned.sh')
|
||||
expect(publishJob).toContain("draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft == true }}")
|
||||
expect(publishJob).toContain('Ensure workflow-dispatch release remains draft')
|
||||
expect(publishJob).toContain("if: github.event_name == 'workflow_dispatch' && inputs.draft == true")
|
||||
expect(publishJob).toContain('gh release edit "v${{ steps.version.outputs.value }}" --draft --repo "${{ github.repository }}"')
|
||||
expect(publishJob).toContain('fail_on_unmatched_files: true')
|
||||
expect(publishJob).toContain('Load release notes')
|
||||
expect(workflow.indexOf('publish-release:')).toBeGreaterThan(workflow.indexOf('build:'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user