feat: add winget package distribution

Adds Windows Package Manager (winget) distribution alongside the existing
crates.io / Homebrew / Nix channels (closes #434).

- Add update-winget job to release.yml that submits a manifest PR to
  microsoft/winget-pkgs on every release via vedantmgoyal9/winget-releaser,
  matching the x86_64-pc-windows-msvc.zip release asset.
- Expose new_version_no_v output from the release job so winget receives a
  bare semver string while Homebrew/Nix keep the v-prefixed tag.
- Seed the initial v0.10.0 manifest (version / installer / locale) under
  .winget/manifests/ so it can be PR'd once to microsoft/winget-pkgs;
  subsequent versions are then handled by the automated job.
- Document the one-time setup (initial PR, fork, WINGET_TOKEN secret) in
  docs/CONTRIBUTING.md.
This commit is contained in:
Yuji Ueki
2026-06-01 19:39:54 +09:00
parent dede682c41
commit e202bd9d88
5 changed files with 93 additions and 0 deletions
+16
View File
@@ -25,6 +25,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.version.outputs.new_version }}
new_version_no_v: ${{ steps.version.outputs.new_version_no_v }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag_sha: ${{ steps.tag_sha.outputs.tag_sha }}
steps:
@@ -47,6 +48,7 @@ jobs:
cargo set-version --bump ${{ github.event.inputs.version_type }}
NEW_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
echo "new_version=v$NEW_VERSION" >> $GITHUB_OUTPUT
echo "new_version_no_v=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "New version: v$NEW_VERSION"
# Run tests before release
@@ -327,3 +329,17 @@ jobs:
git add Formula/gittype.rb
git commit -m "chore: update gittype to $VERSION"
git push
update-winget:
name: Update WinGet Package
runs-on: ubuntu-latest
needs: [release, build-and-upload]
steps:
- name: Submit manifest to winget-pkgs
uses: vedantmgoyal9/winget-releaser@v2
with:
identifier: unhappychoice.gittype
version: ${{ needs.release.outputs.new_version_no_v }}
release-tag: ${{ needs.release.outputs.new_version }}
installers-regex: 'x86_64-pc-windows-msvc\.zip$'
token: ${{ secrets.WINGET_TOKEN }}
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json
PackageIdentifier: unhappychoice.gittype
PackageVersion: 0.10.0
InstallerType: zip
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: gittype.exe
PortableCommandAlias: gittype
Commands:
- gittype
ReleaseDate: 2026-04-20
Installers:
- Architecture: x64
InstallerUrl: https://github.com/unhappychoice/gittype/releases/download/v0.10.0/gittype-v0.10.0-x86_64-pc-windows-msvc.zip
InstallerSha256: 62E625B18AD860235BF9E1A618525FB20B7E0BFF5614D142E2803629D163A8B8
ManifestType: installer
ManifestVersion: 1.6.0
@@ -0,0 +1,34 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json
PackageIdentifier: unhappychoice.gittype
PackageVersion: 0.10.0
PackageLocale: en-US
Publisher: unhappychoice
PublisherUrl: https://github.com/unhappychoice
PublisherSupportUrl: https://github.com/unhappychoice/gittype/issues
PackageName: GitType
PackageUrl: https://github.com/unhappychoice/gittype
License: MIT
LicenseUrl: https://github.com/unhappychoice/gittype/blob/main/LICENSE
Copyright: Copyright (c) unhappychoice
ShortDescription: A typing practice tool using your own code repositories
Description: |-
GitType is a Rust CLI typing game that turns source code from real repositories
into typing challenges. It parses code with tree-sitter, renders a terminal UI,
tracks real-time WPM/accuracy/consistency metrics, and unlocks developer titles
through a ranking system. Multi-language support includes Rust, TypeScript,
JavaScript, Python, Go, Ruby, Swift, Kotlin, Java, PHP, C#, C, C++, Haskell,
Dart, Scala, Clojure, Elixir, Erlang, and Zig.
Moniker: gittype
Tags:
- cli
- code
- developer
- git
- practice
- terminal
- tui
- typing
ReleaseNotesUrl: https://github.com/unhappychoice/gittype/releases/tag/v0.10.0
ManifestType: defaultLocale
ManifestVersion: 1.6.0
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json
PackageIdentifier: unhappychoice.gittype
PackageVersion: 0.10.0
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.6.0
+18
View File
@@ -449,6 +449,24 @@ pub fn extract_chunks(
---
## Release Distribution
GitType is distributed through several package managers. Most channels are updated automatically by the release workflow (`.github/workflows/release.yml`); a few require one-time setup.
### winget (Windows)
The release workflow submits a manifest PR to [`microsoft/winget-pkgs`](https://github.com/microsoft/winget-pkgs) via [`vedantmgoyal9/winget-releaser`](https://github.com/vedantmgoyal9/winget-releaser) on every release.
**One-time setup:**
1. The initial `0.10.0` manifest lives under `.winget/manifests/u/unhappychoice/gittype/0.10.0/` and must be PR'd manually to `microsoft/winget-pkgs` once. After it is merged, subsequent versions are added automatically.
2. Create a fork of `microsoft/winget-pkgs` under the owner account.
3. Create a GitHub PAT (classic) with `public_repo` scope that can push to the fork, and register it as the `WINGET_TOKEN` repository secret.
**Package identifier:** `unhappychoice.gittype`
---
## Getting Help
- **Issues**: Browse existing issues or create a new one