Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(ci): publish winget manifests from CI with tag-pinned installer URLs (#2089)

void4b4f290cab69
diff --git a/.github/workflows/update-winget.yml b/.github/workflows/update-winget.yml
new file mode 100644
index 000000000..4f935d21e
--- /dev/null
+++ b/.github/workflows/update-winget.yml
@@ -0,0 +1,64 @@
+name: Update WinGet package
+
+on:
+ release:
+ types: [published]
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: "Release tag to submit (e.g. v1.10.1). Defaults to the newest stable app release."
+ required: false
+ type: string
+
+permissions:
+ contents: read
+
+# Two releases published back to back would otherwise race two komac
+# submissions against the same fork branch.
+concurrency:
+ group: update-winget
+ cancel-in-progress: false
+
+jobs:
+ update-winget:
+ # winget-releaser handles stable releases only, so skip prereleases here
+ # rather than letting the version guard below fail the run.
+ if: github.event_name != 'release' || !github.event.release.prerelease
+ runs-on: ubuntu-latest
+ steps:
+ - name: Get release version
+ id: release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ GH_REPO: ${{ github.repository }}
+ EVENT_NAME: ${{ github.event_name }}
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
+ INPUT_TAG: ${{ inputs.tag }}
+ run: |
+ if [ "$EVENT_NAME" = "release" ]; then
+ version="$RELEASE_TAG"
+ elif [ -n "$INPUT_TAG" ]; then
+ version="$INPUT_TAG"
+ else
+ # Not `gh release view`: it resolves to /releases/latest, which
+ # ignores tag shape, and this repo interleaves helper-binary
+ # releases (windows-mic-listener-v1.1.0, ...) with app releases.
+ version=$(gh release list --limit 50 --exclude-drafts --exclude-pre-releases \
+ --json tagName --jq 'map(.tagName) | map(select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+$"))) | first')
+ fi
+ version="${version#v}"
+ if ! echo "$version" | grep -qP '^\d+\.\d+\.\d+$'; then
+ echo "::error::Invalid version format: $version"
+ exit 1
+ fi
+ echo "version=$version" >> "$GITHUB_OUTPUT"
+
+ - name: Submit to winget-pkgs
+ # Pinned to a commit: a moving tag on a third-party action would be
+ # handed a PAT that can write to every public repo the owner can reach.
+ uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e # v2
+ with:
+ identifier: OpenWhispr.OpenWhispr
+ release-tag: v${{ steps.release.outputs.version }}
+ installers-regex: 'OpenWhispr-Setup-.*\.exe$'
+ token: ${{ secrets.WINGET_TOKEN }}