#!/bin/bash # # Update winget manifest files for a new release # # Usage: ./scripts/update-winget.sh # Example: ./scripts/update-winget.sh 0.31.0 # set -e VERSION="${1:-}" if [ -z "$VERSION" ]; then echo "Usage: $0 " echo "Example: $0 0.31.0" exit 1 fi # Remove 'v' prefix if present VERSION="${VERSION#v}" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" WINGET_DIR="$SCRIPT_DIR/../winget" # Get SHA256 from release checksums echo "Fetching SHA256 for v$VERSION..." SHA256=$(curl -sL "https://github.com/gastownhall/beads/releases/download/v$VERSION/checksums.txt" | grep windows_amd64 | awk '{print $1}') if [ -z "$SHA256" ]; then echo "Error: Could not find Windows checksum for v$VERSION" echo "Make sure the release exists: https://github.com/gastownhall/beads/releases/tag/v$VERSION" exit 1 fi # Convert to uppercase for winget SHA256=$(echo "$SHA256" | tr '[:lower:]' '[:upper:]') echo "SHA256: $SHA256" echo "" echo "Updating manifest files..." # Update version manifest cat > "$WINGET_DIR/SteveYegge.beads.yaml" << EOF # yaml-language-server: \$schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json PackageIdentifier: SteveYegge.beads PackageVersion: $VERSION DefaultLocale: en-US ManifestType: version ManifestVersion: 1.6.0 EOF # Update installer manifest (PortableCommandAlias required — GH#4908) cat > "$WINGET_DIR/SteveYegge.beads.installer.yaml" << EOF # yaml-language-server: \$schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json PackageIdentifier: SteveYegge.beads PackageVersion: $VERSION InstallerType: zip NestedInstallerType: portable NestedInstallerFiles: - RelativeFilePath: bd.exe PortableCommandAlias: bd Installers: - Architecture: x64 InstallerUrl: https://github.com/gastownhall/beads/releases/download/v$VERSION/beads_${VERSION}_windows_amd64.zip InstallerSha256: $SHA256 ManifestType: installer ManifestVersion: 1.6.0 EOF # Update locale manifest cat > "$WINGET_DIR/SteveYegge.beads.locale.en-US.yaml" << EOF # yaml-language-server: \$schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json PackageIdentifier: SteveYegge.beads PackageVersion: $VERSION PackageLocale: en-US Publisher: Steve Yegge PublisherUrl: https://github.com/steveyegge PublisherSupportUrl: https://github.com/gastownhall/beads/issues Author: Steve Yegge PackageName: beads PackageUrl: https://github.com/gastownhall/beads License: MIT LicenseUrl: https://github.com/gastownhall/beads/blob/main/LICENSE Copyright: Copyright (c) 2024 Steve Yegge ShortDescription: Distributed, Dolt-powered graph issue tracker for AI agents Description: | beads (bd) is a distributed, Dolt-powered graph issue tracker designed for AI-supervised coding workflows. It provides a persistent, structured memory for coding agents, replacing messy markdown plans with a dependency-aware graph that allows agents to handle long-horizon tasks without losing context. Moniker: bd Tags: - issue-tracker - ai - coding-assistant - git - cli - developer-tools ReleaseNotesUrl: https://github.com/gastownhall/beads/releases/tag/v$VERSION ManifestType: defaultLocale ManifestVersion: 1.6.0 EOF # GasTownHall.Beads is the package id users install today (v1.x on winget-pkgs). # Always set PortableCommandAlias so WinGet\\Links\\bd.exe is created (GH#4908). # SHA256 for arm64 is left for the releaser to fill from checksums.txt when present. ARM_SHA=$(curl -sL "https://github.com/gastownhall/beads/releases/download/v$VERSION/checksums.txt" | grep 'windows_arm64' | awk '{print $1}' | tr '[:lower:]' '[:upper:]') ARM_SHA_IS_PLACEHOLDER=0 if [ -z "$ARM_SHA" ]; then ARM_SHA="0000000000000000000000000000000000000000000000000000000000000000" ARM_SHA_IS_PLACEHOLDER=1 fi # Keep this header in step with the checked-in winget/GasTownHall.Beads.installer.yaml: # the first run of this script overwrites that file, so anything documented only # there (the GH#4908 rationale) would be silently dropped. cat > "$WINGET_DIR/GasTownHall.Beads.installer.yaml" << EOF # yaml-language-server: \$schema=https://aka.ms/winget-manifest.installer.1.12.0.schema.json # Canonical installer for PackageIdentifier GasTownHall.Beads (published under # manifests/g/GasTownHall/Beads// in microsoft/winget-pkgs). # # PortableCommandAlias is REQUIRED so winget creates # %LOCALAPPDATA%\\Microsoft\\WinGet\\Links\\bd.exe. Without it, only the package # folder is on PATH (visible only to processes started after install) and # already-running shells never see \`bd\` (GH#4908). # # Commands: is search metadata only — it does NOT create the Links symlink. PackageIdentifier: GasTownHall.Beads PackageVersion: $VERSION InstallerType: zip NestedInstallerType: portable NestedInstallerFiles: - RelativeFilePath: bd.exe PortableCommandAlias: bd Commands: - bd ReleaseDate: $(date -u +%F) Installers: - Architecture: x64 InstallerUrl: https://github.com/gastownhall/beads/releases/download/v$VERSION/beads_${VERSION}_windows_amd64.zip InstallerSha256: $SHA256 - Architecture: arm64 InstallerUrl: https://github.com/gastownhall/beads/releases/download/v$VERSION/beads_${VERSION}_windows_arm64.zip InstallerSha256: "$ARM_SHA" ManifestType: installer ManifestVersion: 1.12.0 EOF echo "" echo "✓ Updated winget manifests for v$VERSION" echo "" echo "Next steps:" echo "1. Commit these changes" echo "2. Fork https://github.com/microsoft/winget-pkgs" echo "3. Prefer GasTownHall.Beads:" echo " copy winget/GasTownHall.Beads.installer.yaml" echo " → manifests/g/GasTownHall/Beads/$VERSION/" echo " (legacy SteveYegge.beads → manifests/s/SteveYegge/beads/$VERSION/)" echo "4. Submit PR to microsoft/winget-pkgs" echo "" echo "Reminder: PortableCommandAlias: bd is required (GH#4908)." # The arm64 fallback above is otherwise disclosed only in a source comment, and # the manifest it writes is schema-valid, so a releaser following the steps # above would publish an installer entry that fails hash validation at install # time. if [ "$ARM_SHA_IS_PLACEHOLDER" -eq 1 ]; then echo "" echo "WARNING: no windows_arm64 checksum found for v$VERSION;" echo " the arm64 InstallerSha256 is a zero placeholder — DO NOT PUBLISH" echo " until it is replaced with the real hash from checksums.txt." fi