Add wingetsource new-version #7

Closed
opened 2026-10-14 01:01:50 -05:00 by jeff · 0 comments
Owner

Part of #4

Add a new-version subcommand to wingetsource that writes a new version of a package that already has one, by copying its newest version and replacing what changes with the release. ADR 0004 (PR #6) records why it lives here rather than in jeff/winget-submit.

Command line

python3 -m wingetsource new-version --manifests manifests \
    --identifier JCOllie.Clipwatch --version 0.3.0 \
    --installer x64=https://git.jcollie.dev/jeff/clipwatch/releases/download/v0.3.0/clipwatch-x86_64-windows.exe \
    [--installer arm64=<url> ...] \
    [--release-notes-url <url>] \
    [--release-date YYYY-MM-DD]

The options may later be added to but never changed or removed: every pinned copy of jeff/winget-submit runs whatever new-version is on main.

Behavior

  • The version copied from is the highest by winget's version ordering (version.py), not by directory name, git date or string order.
  • Version file: PackageVersion replaced; everything else copied.
  • Installer file: copied, with PackageVersion and ReleaseDate replaced, and each installer's InstallerUrl and InstallerSha256 replaced, matched by Architecture. The SHA-256 is computed by downloading each installer, upper-case hex as in the existing manifests. ReleaseDate is --release-date, defaulting to today in UTC.
  • Default locale file: copied, with PackageVersion replaced and ReleaseNotesUrl set to --release-notes-url, or removed when the option is not given. Nothing else is rewritten — the URLs in it are copied as they are.
  • Comments are kept as they are, including the SPDX header and the yaml-language-server schema line.
  • It fails, writing nothing, when:
    • the version directory already exists;
    • the package has no versions (the first version is still written by hand);
    • the set of --installer architectures differs from the newest version's.

check re-downloads the installers when it runs; that is deliberate, so that the check stays independent of the writer.

Also

  • Unit tests under tests/, with installer downloads faked the way check_installers takes download=. Cover version ordering (0.10.0 above 0.9.0), the architecture mismatch, the missing package, the existing directory, and ReleaseNotesUrl present and absent.
  • The README's "A new version arrives as a pull request, written by hand" and the Manifests section of CONTRIBUTING.md say how a new version is now written.

Done when

new-version followed by check --changed-since origin/main passes on a version it wrote, the tests pass in CI, and the documentation describes it.

Part of #4 Add a `new-version` subcommand to `wingetsource` that writes a new version of a package that already has one, by copying its newest version and replacing what changes with the release. ADR 0004 (PR #6) records why it lives here rather than in `jeff/winget-submit`. ## Command line ```console python3 -m wingetsource new-version --manifests manifests \ --identifier JCOllie.Clipwatch --version 0.3.0 \ --installer x64=https://git.jcollie.dev/jeff/clipwatch/releases/download/v0.3.0/clipwatch-x86_64-windows.exe \ [--installer arm64=<url> ...] \ [--release-notes-url <url>] \ [--release-date YYYY-MM-DD] ``` The options may later be added to but never changed or removed: every pinned copy of `jeff/winget-submit` runs whatever `new-version` is on `main`. ## Behavior - The version copied from is the **highest by winget's version ordering** (`version.py`), not by directory name, git date or string order. - **Version file**: `PackageVersion` replaced; everything else copied. - **Installer file**: copied, with `PackageVersion` and `ReleaseDate` replaced, and each installer's `InstallerUrl` and `InstallerSha256` replaced, matched by `Architecture`. The SHA-256 is computed by downloading each installer, upper-case hex as in the existing manifests. `ReleaseDate` is `--release-date`, defaulting to today in UTC. - **Default locale file**: copied, with `PackageVersion` replaced and `ReleaseNotesUrl` set to `--release-notes-url`, or removed when the option is not given. Nothing else is rewritten — the URLs in it are copied as they are. - Comments are kept as they are, including the SPDX header and the `yaml-language-server` schema line. - It fails, writing nothing, when: - the version directory already exists; - the package has no versions (the first version is still written by hand); - the set of `--installer` architectures differs from the newest version's. `check` re-downloads the installers when it runs; that is deliberate, so that the check stays independent of the writer. ## Also - Unit tests under `tests/`, with installer downloads faked the way `check_installers` takes `download=`. Cover version ordering (`0.10.0` above `0.9.0`), the architecture mismatch, the missing package, the existing directory, and `ReleaseNotesUrl` present and absent. - The README's "A new version arrives as a pull request, written by hand" and the **Manifests** section of CONTRIBUTING.md say how a new version is now written. ## Done when `new-version` followed by `check --changed-since origin/main` passes on a version it wrote, the tests pass in CI, and the documentation describes it.
jeff closed this issue 2026-10-14 01:12:04 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#1 Build the submit action
jeff/winget-submit
Reference
jeff/winget-pkgs#7
No description provided.