feat: add winget-releaser workflow for automatic WinGet releases#191
feat: add winget-releaser workflow for automatic WinGet releases#191octo-patch wants to merge 1 commit intowebadderall:mainfrom
Conversation
|
Warning
|
| Cohort / File(s) | Summary |
|---|---|
WinGet Release Automation .github/workflows/winget-releaser.yml |
New GitHub Actions workflow that automatically publishes releases to WinGet when a GitHub release is created. Configured with package identifier Webadderall.Recordly, Windows x64 executable regex pattern, and authentication token from secrets. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
🐰 Our releases now hop straight to WinGet's door,
No manual updates forevermore!
Withwinget install, the users will cheer,
Recordly appears like magic so clear—
Automation makes this rabbit so glad! ✨
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The PR title accurately and concisely describes the main change: adding a GitHub Actions workflow for automated WinGet releases. |
| Description check | ✅ Passed | The PR description covers all essential sections including problem, solution, setup requirements, and testing notes; it follows the expected structure well. |
| Linked Issues check | ✅ Passed | The workflow implementation fully satisfies issue #177 requirements: uses winget-releaser action, triggers on released events, specifies correct identifier and token inputs. |
| Out of Scope Changes check | ✅ Passed | All changes are directly scoped to the stated objective; only the winget-releaser workflow file was added with no extraneous modifications. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/winget-releaser.yml (1)
9-9: Pin the action to a specific version instead of@latest.Using
@latestcan cause unexpected breakage when the action is updated with breaking changes. Pin to a specific version like@v2(the current stable release) for reproducibility.Proposed fix
- - uses: vedantmgoyal9/winget-releaser@latest + - uses: vedantmgoyal9/winget-releaser@v2🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/winget-releaser.yml at line 9, Replace the floating action reference vedantmgoyal9/winget-releaser@latest with a pinned release (e.g., vedantmgoyal9/winget-releaser@v2 or a specific tag/sha) in the workflow so the run uses a stable, reproducible version; update the uses entry in the workflow step that currently contains vedantmgoyal9/winget-releaser@latest to the chosen pinned tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/winget-releaser.yml:
- Around line 2-4: The workflow triggers on the `release` event which can race
with `release.yml` asset uploads; switch to a post-publish trigger or move the
job to the release workflow: either change the `on:` block to use `workflow_run`
for the "Publish Release" workflow (types: [completed]) and ensure you filter
for success and extract the release tag from the triggering run, or add a
`publish-to-winget` job inside `release.yml` that declares `needs:
publish-release-assets` so the winget step (the vedantmgoyal9/winget-releaser
invocation) only runs after assets are uploaded.
---
Nitpick comments:
In @.github/workflows/winget-releaser.yml:
- Line 9: Replace the floating action reference
vedantmgoyal9/winget-releaser@latest with a pinned release (e.g.,
vedantmgoyal9/winget-releaser@v2 or a specific tag/sha) in the workflow so the
run uses a stable, reproducible version; update the uses entry in the workflow
step that currently contains vedantmgoyal9/winget-releaser@latest to the chosen
pinned tag.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6bbf295d-616f-4f5a-b278-4851cf1373fd
📒 Files selected for processing (1)
.github/workflows/winget-releaser.yml
| on: | ||
| release: | ||
| types: [released] |
There was a problem hiding this comment.
Race condition: assets may not be uploaded when this workflow runs.
The released event fires at approximately the same time as the published event. However, release.yml (triggered by published) builds and uploads release assets, which takes significant time. This workflow may start before assets are available, causing winget-releaser to fail.
Consider one of these alternatives:
- Use
workflow_runtrigger to run afterrelease.ymlcompletes:
on:
workflow_run:
workflows: ["Publish Release"]
types: [completed]Then filter for success and extract the release tag from the triggering workflow.
- Add this as a job in
release.ymlthat depends onpublish-release-assets:
publish-to-winget:
name: Publish to WinGet
needs: publish-release-assets
runs-on: windows-latest
steps:
- uses: vedantmgoyal9/winget-releaser@v2
with:
identifier: Webadderall.Recordly
installers-regex: 'windows\-x64\.exe'
token: ${{ secrets.WINGET_ACC_TOKEN }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/winget-releaser.yml around lines 2 - 4, The workflow
triggers on the `release` event which can race with `release.yml` asset uploads;
switch to a post-publish trigger or move the job to the release workflow: either
change the `on:` block to use `workflow_run` for the "Publish Release" workflow
(types: [completed]) and ensure you filter for success and extract the release
tag from the triggering run, or add a `publish-to-winget` job inside
`release.yml` that declares `needs: publish-release-assets` so the winget step
(the vedantmgoyal9/winget-releaser invocation) only runs after assets are
uploaded.
Fixes #177
Problem
When a new Recordly release is published, the WinGet package (
Webadderall.Recordly) needs to be manually updated in themicrosoft/winget-pkgsrepository. This is error-prone and slow.Solution
Add a GitHub Actions workflow that automatically publishes new releases to WinGet using winget-releaser.
The workflow triggers on
releasedevents and uses thevedantmgoyal9/winget-releaser@latestaction to push the new version to WinGet.Setup Required
To activate this workflow, the repo maintainer needs to:
public_reposcope at https://github.com/settings/tokens/newWINGET_ACC_TOKENTesting
This is a CI workflow that only runs on
releasedevents. Once theWINGET_ACC_TOKENsecret is configured, it will automatically run on the next release.