Skip to content

ci: submit to winget from the release job - #196

Merged
deansheather merged 2 commits into
mainfrom
ci/winget-in-release
Nov 18, 2026
Merged

deansheather merged 2 commits into
mainfrom
ci/winget-in-release

Conversation

@deansheather

@deansheather deansheather commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Moves the winget submission into the release job, so a release needs one approval in the code-signing environment instead of two (code-signing, then winget).

Before merging: set a fresh cdrci token as CDRCI_GITHUB_TOKEN in the code-signing environment. Today it only exists in winget, so the new step would fail with "winget-token is empty". Retiring the winget environment is a separate coder/github-org-terraform PR, which goes after this one.

Changes

  • New .github/actions/winget/action.yml: a local composite action with the old winget job's steps:

    • sync cdrci's fork of winget-pkgs;
    • install wingetcreate;
    • submit the updated manifest;
    • comment on the winget-pkgs PR.

    Other changes in the action:

    • It drops the old job's checkout and "Fetch git tags" steps, because none of the steps read the working tree.
    • It downloads wingetcreate.exe from the pinned GitHub release v1.28.1.0, not aka.ms/wingetcreate/latest, and fails unless its SHA-256 is 63d980ba…0413.
      • aka.ms currently redirects to that same release, so v0.9.1 used this exact binary.
      • Three sources agree on the hash: my own download, GitHub's asset digest, and Microsoft's wingetcreate.exe.txt checksum file.
      • The binary carries a Microsoft Authenticode signature.
      • Upgrading means changing the version and hash in the action. ci: pin wingetcreate in publish-winget and check its SHA-256 coder#32387 pins the same build.
    • It checks its inputs up front: the version must be X.Y.Z and the token must be non-empty.
    • Inputs reach the scripts through env: only, never interpolated into them.
  • release.yaml:

    • The winget job is replaced by a final Submit to winget step in release. Only that step receives CDRCI_GITHUB_TOKEN; the build, signing and appcast steps never see it.
    • The step is last, so a winget failure can't block the GitHub release or the appcast update. The release just shows as failed.
    • timeout-minutes goes from 15 to 25. In v0.9.1, release took about 5 minutes and winget under 3.
    • The outputs: block is removed; only the winget job read it.
    • The comments are updated.

Trade-offs

  • The token now sits in the same environment as the signing setup. Anyone who could run code in code-signing could also read the cdrci token. That's acceptable because code-signing only runs on v* tags, after a desktop release manager approves.
  • The submission step's github.token now has contents: write, because it shares the release job's permissions. The old job had contents: read. The step only uses it for gh release view.

Checks

  • actionlint -shellcheck= .github/workflows/release.yaml: clean. The unknown depot-windows-latest label warning is gone with the job.
  • zizmor --offline on both files: no errors or warnings.
  • v0.9.1 ran these steps successfully as a separate job and opened New version: Coder.CoderDesktop version 0.9.1 microsoft/winget-pkgs#483234. The commands are unchanged except for the wingetcreate download and its path, which moves to $RUNNER_TEMP.

AI disclosure: an AI coding agent (Xum) wrote this change and ran the checks above at my direction. It stays a draft until I've reviewed it.

@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T12:07:43.620347Z 7ed4dbc Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 7ed4dbc3de

ℹ️ 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".

@deansheather
deansheather merged commit a35348d into main Nov 18, 2026
6 checks passed
@deansheather
deansheather deleted the ci/winget-in-release branch November 18, 2026 12:37
deansheather added a commit to coder/coder that referenced this pull request Nov 18, 2026
Pins the `wingetcreate.exe` that `publish-winget` downloads and checks
its SHA-256 before running it. The job runs in the `release-publish`
environment with cdrci's token, so it shouldn't run whatever
`aka.ms/wingetcreate/latest` currently points at.

## Changes (`.github/workflows/release.yaml`, `publish-winget` job)

- Downloads `wingetcreate.exe` from the GitHub release `v1.28.1.0` of
microsoft/winget-create, not `https://aka.ms/wingetcreate/latest`.
- Fails if the file's SHA-256 isn't
`63d980ba79e97042395bd6eb5992c2db9e01e9e7a8a22958a95c288f27310413`, and
deletes the file.
- Keeps the output path `.\wingetcreate.exe`, so the next step doesn't
change.
- To upgrade, change `WINGETCREATE_VERSION` and `WINGETCREATE_SHA256`
together. The comment above the step says where to find both.

## Where the hash comes from

- **Same build as now:** `aka.ms/wingetcreate/latest` currently
redirects to `releases/download/v1.28.1.0/wingetcreate.exe`, so releases
already use this binary.
- **Three sources agree on the hash:**
  - my own download;
  - GitHub's asset digest for `wingetcreate.exe`;
- the `wingetcreate.exe.txt` checksum file Microsoft publishes in the
same release.
- **Signature:** the binary carries a Microsoft Authenticode signature.

coder/coder-desktop-windows#196 pins the same version and hash.

## Checks

- `actionlint .github/workflows/release.yaml`: clean.
- `zizmor --offline .github/workflows/release.yaml`: no errors or
warnings, on `main` or on this branch.

---

AI disclosure: an AI coding agent (Xum) wrote this change and ran the
checks above at my direction. It stays a draft until I've reviewed it.
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.

3 participants