Fix publish workflows: wait for release build to finish

The Chocolatey and WinGet publish workflows triggered on
release: [released], which fires simultaneously with the release
build. Since MSIs take ~45 minutes to build, the publish workflows
failed with 404 errors.

Switch both to workflow_run trigger so they wait for the "Upload
releases" workflow to complete before attempting to publish.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Carlos Fernandez
2026-02-19 17:07:59 -08:00
parent 350799f9ad
commit e17617fa53
2 changed files with 14 additions and 6 deletions

View File

@@ -10,8 +10,9 @@
name: Publish to Chocolatey
on:
release:
types: [released]
workflow_run:
workflows: ["Upload releases"]
types: [completed]
workflow_dispatch:
inputs:
release_tag:
@@ -22,6 +23,9 @@ on:
jobs:
publish:
runs-on: windows-latest
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout repository
uses: actions/checkout@v6
@@ -30,7 +34,7 @@ jobs:
id: version
shell: bash
run: |
TAG="${{ github.event.inputs.release_tag || github.event.release.tag_name }}"
TAG="${{ github.event.inputs.release_tag || github.event.workflow_run.head_branch }}"
# Strip 'v' prefix if present
VERSION="${TAG#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT

View File

@@ -16,8 +16,9 @@
name: Publish to WinGet
on:
release:
types: [released]
workflow_run:
workflows: ["Upload releases"]
types: [completed]
workflow_dispatch:
inputs:
release_tag:
@@ -28,6 +29,9 @@ on:
jobs:
publish:
runs-on: windows-latest
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
steps:
- name: Publish to WinGet
uses: vedantmgoyal9/winget-releaser@v2
@@ -35,4 +39,4 @@ jobs:
identifier: CCExtractor.CCExtractor
installers-regex: '\.msi$' # Only use the MSI installer
token: ${{ secrets.WINGET_TOKEN }}
release-tag: ${{ github.event.inputs.release_tag || github.event.release.tag_name }}
release-tag: ${{ github.event.inputs.release_tag || github.event.workflow_run.head_branch }}