Skip to content

Fix winget-publish CI: fall back to new for first-time package submission - #236

Merged
fernandotonon merged 3 commits into
masterfrom
fix/winget-publish-new-package
Apr 1, 2026
Merged

Fix winget-publish CI: fall back to new for first-time package submission#236
fernandotonon merged 3 commits into
masterfrom
fix/winget-publish-new-package

Conversation

@fernandotonon

@fernandotonon fernandotonon commented Mar 31, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • QtMeshEditor v2.18.0 published to WinGet: portable installer added with two command aliases (qtmesheditor, qtmesh), plus localized metadata and release information.
  • Chores
    • Improved Windows submission flow with a fallback submission path to increase deployment reliability and reduce failed publishes.

The wingetcreate update command requires the package to already exist in
microsoft/winget-pkgs. For first-time submissions, fall back to
wingetcreate new. Also add generated 2.18.0 manifests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds fallback logic in the WinGet CI submission step to run wingetcreate new when wingetcreate update fails, and adds three WinGet manifests for FernandoTonon.QtMeshEditor v2.18.0 (version, installer, en-US locale).

Changes

Cohort / File(s) Summary
CI/CD Pipeline
\.github/workflows/deploy.yml
Replaces a single wingetcreate update ... call with logic that captures the command exit code and, on non‑zero exit, runs wingetcreate new $url --submit --token ... as a fallback; step remains continue-on-error: true.
WinGet Manifests: QtMeshEditor v2.18.0
winget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.yaml, .../FernandoTonon.QtMeshEditor.installer.yaml, .../FernandoTonon.QtMeshEditor.locale.en-US.yaml
Add version manifest, installer manifest (portable ZIP with aliases qtmesheditorbin\QtMeshEditor.exe and qtmeshbin\qtmesh.exe, x64 download URL + SHA256), and en‑US locale manifest (publisher, homepage/support, descriptions, tags, license, moniker, release notes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I hopped through CI with a twitchy nose,
When update tripped, I found a newose,
Manifests snug, two aliases in line,
Portable zip and manifests fine,
A joyful hop — releases align 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix winget-publish CI: fall back to new for first-time package submission' directly and clearly summarizes the main change: adding fallback logic to the CI workflow when the update command fails for new packages.
Description check ✅ Passed The PR description partially follows the template with a clear Summary section addressing the CI fix and manifest additions, but lacks explicit Bugfixes and Features sections.
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
  • Commit unit tests in branch fix/winget-publish-new-package

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7027e3891b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1654 to +1657
.\wingetcreate.exe new $url `
--version $version `
--submit `
--token ${{ secrets.WINGET_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a non-interactive command for first-time WinGet publish

When update fails, this fallback calls wingetcreate.exe new with --version/--submit, but new is an interactive wizard command (not the CI-oriented update flow), so in CI it can fail on unsupported args or block waiting for prompts. In the exact first-submission case this change targets, the job still won’t reliably create/submit a manifest PR automatically.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/deploy.yml:
- Around line 1647-1658: The fallback invocation of wingetcreate.exe new uses
unsupported flags (--version and --submit) which will cause it to fail; update
the fallback call for the new command (wingetcreate.exe new) to only pass
supported options: the package URL (positional), the token (--token or -t) and
optionally --no-open (-n) or --out (-o) if needed, removing --version and
--submit so the first-time submission can succeed.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b0880e1-7c53-4c64-937c-977c7d5b7023

📥 Commits

Reviewing files that changed from the base of the PR and between df4cdac and 7027e38.

📒 Files selected for processing (4)
  • .github/workflows/deploy.yml
  • winget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.installer.yaml
  • winget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.locale.en-US.yaml
  • winget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.yaml

Comment on lines +1647 to +1658
# Try 'update' first (package already in winget-pkgs); fall back to 'new' for first submission
$result = .\wingetcreate.exe update FernandoTonon.QtMeshEditor `
--version $version `
--urls $url `
--submit `
--token ${{ secrets.WINGET_TOKEN }}
if ($LASTEXITCODE -ne 0) {
.\wingetcreate.exe new $url `
--version $version `
--submit `
--token ${{ secrets.WINGET_TOKEN }}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify workflow usage vs documented 'new' arguments
rg -n -C2 'wingetcreate\.exe (update|new)|--version|--submit' .github/workflows/deploy.yml

# Check official 'new' command docs for available args
curl -sL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/new.md \
  | rg -n '## Usage|## Arguments|--version|--submit|-t, --token|-o, --out|-n, --no-open'

Repository: fernandotonon/QtMeshEditor

Length of output: 4025


wingetcreate new fallback uses unsupported flags that will cause the command to fail.

Lines 1655 (--version) and 1656 (--submit) are not valid arguments for the new command according to the official winget-create documentation. The new command only supports -o, --out, -t, --token, and -n, --no-open. Remove these unsupported flags to allow the fallback to handle first-time package submissions correctly.

Suggested fix
          if ($LASTEXITCODE -ne 0) {
            .\wingetcreate.exe new $url `
-             --version $version `
-             --submit `
              --token ${{ secrets.WINGET_TOKEN }}
          }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Try 'update' first (package already in winget-pkgs); fall back to 'new' for first submission
$result = .\wingetcreate.exe update FernandoTonon.QtMeshEditor `
--version $version `
--urls $url `
--submit `
--token ${{ secrets.WINGET_TOKEN }}
if ($LASTEXITCODE -ne 0) {
.\wingetcreate.exe new $url `
--version $version `
--submit `
--token ${{ secrets.WINGET_TOKEN }}
}
# Try 'update' first (package already in winget-pkgs); fall back to 'new' for first submission
$result = .\wingetcreate.exe update FernandoTonon.QtMeshEditor `
--version $version `
--urls $url `
--submit `
--token ${{ secrets.WINGET_TOKEN }}
if ($LASTEXITCODE -ne 0) {
.\wingetcreate.exe new $url `
--token ${{ secrets.WINGET_TOKEN }}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy.yml around lines 1647 - 1658, The fallback
invocation of wingetcreate.exe new uses unsupported flags (--version and
--submit) which will cause it to fail; update the fallback call for the new
command (wingetcreate.exe new) to only pass supported options: the package URL
(positional), the token (--token or -t) and optionally --no-open (-n) or --out
(-o) if needed, removing --version and --submit so the first-time submission can
succeed.

wingetcreate new does not accept --version or --urls flags; the installer
URL is passed positionally and the version is inferred from the installer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/deploy.yml (1)

1654-1658: ⚠️ Potential issue | 🟠 Major

Remove unsupported --submit from wingetcreate new.

At Line 1656, new is invoked with --submit. In current winget-create docs, new supports --token but not --submit, so fallback can fail for first-time submissions.

Proposed fix
           if ($LASTEXITCODE -ne 0) {
             # 'new' does not support --version or --urls; pass URL positionally
             .\wingetcreate.exe new $url `
-              --submit `
               --token ${{ secrets.WINGET_TOKEN }}
           }
#!/bin/bash
set -euo pipefail

# Verify allowed args for 'new'
curl -sL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/new.md \
  | rg -n '## Usage|## Arguments|--submit|--token|-n, --no-open|-o, --out'

# Verify '--submit' support on 'update'
curl -sL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/update.md \
  | rg -n '## Usage|## Arguments|--submit'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy.yml around lines 1654 - 1658, The workflow invokes
"wingetcreate.exe new" with an unsupported "--submit" flag (the command is
called in the block containing ".\wingetcreate.exe new $url ` --submit ` --token
${{ secrets.WINGET_TOKEN }}"), so remove the "--submit" token from that
invocation and leave the URL passed positionally and the "--token" option
intact; ensure the call becomes ".\wingetcreate.exe new $url ` --token ${{
secrets.WINGET_TOKEN }}" so first-time submissions don't fail due to the
unsupported flag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/deploy.yml:
- Around line 1654-1658: The workflow invokes "wingetcreate.exe new" with an
unsupported "--submit" flag (the command is called in the block containing
".\wingetcreate.exe new $url ` --submit ` --token ${{ secrets.WINGET_TOKEN }}"),
so remove the "--submit" token from that invocation and leave the URL passed
positionally and the "--token" option intact; ensure the call becomes
".\wingetcreate.exe new $url ` --token ${{ secrets.WINGET_TOKEN }}" so
first-time submissions don't fail due to the unsupported flag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 650b9c0c-df84-4ad0-8667-844f253e262f

📥 Commits

Reviewing files that changed from the base of the PR and between 7027e38 and c9385c6.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/deploy.yml (1)

1655-1658: ⚠️ Potential issue | 🟠 Major

Remove unsupported --submit from wingetcreate new.

Line 1657 still passes --submit to new. In the official winget-create docs, new supports --token, --out, and --no-open, but not --submit; this can still break the first-time fallback path.

Suggested fix
           if ($LASTEXITCODE -ne 0) {
             # 'new' does not support --version or --urls; pass URL positionally
             .\wingetcreate.exe new $url `
-              --submit `
-              --token ${{ secrets.WINGET_TOKEN }}
+              --token ${{ secrets.WINGET_TOKEN }} `
+              --no-open
           }
#!/bin/bash
set -euo pipefail

echo "Current workflow usage:"
rg -n -C2 'wingetcreate\.exe (update|new)|--submit|--version|--urls|--token' .github/workflows/deploy.yml

echo
echo "Official new command args (should NOT include --submit):"
curl -fsSL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/new.md \
  | rg -n -- '## Usage|## Arguments|--submit|-o, --out|-t, --token|-n, --no-open'

echo
echo "Official update command args (does include --submit):"
curl -fsSL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/update.md \
  | rg -n -- '## Usage|## Arguments|--submit'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy.yml around lines 1655 - 1658, The workflow invokes
"wingetcreate.exe new $url" but incorrectly passes the unsupported flag
"--submit"; remove the "--submit" token from the "wingetcreate.exe new $url"
command so the "new" subcommand uses only supported args (e.g., --token, --out,
--no-open) while leaving any "wingetcreate.exe update" usages that require
--submit unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/deploy.yml:
- Around line 1655-1658: The workflow invokes "wingetcreate.exe new $url" but
incorrectly passes the unsupported flag "--submit"; remove the "--submit" token
from the "wingetcreate.exe new $url" command so the "new" subcommand uses only
supported args (e.g., --token, --out, --no-open) while leaving any
"wingetcreate.exe update" usages that require --submit unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75b64b2e-aece-4888-b151-062d005e5c80

📥 Commits

Reviewing files that changed from the base of the PR and between c9385c6 and 72ee6f4.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yml

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant