From 278c9b709e98cd3926b41e1736734afffdb3abb7 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 20:51:39 -0500 Subject: [PATCH 01/12] ci(release): GoReleaser + release-on-publish workflow --- .github/workflows/release.yml | 22 +++--------- .goreleaser.yaml | 63 +++++++++++++---------------------- 2 files changed, 28 insertions(+), 57 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4387c43..5dddc5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,7 @@ name: release on: - push: - tags: - - 'v*.*.*' - workflow_dispatch: {} # allow manual runs release: - types: [published] # run if you publish a release by hand + types: [published] permissions: contents: write @@ -18,25 +14,15 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # tags required + fetch-depth: 0 - uses: actions/setup-go@v5 with: - go-version: '1.23.x' - - uses: actions/cache@v4 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version: '1.22' - uses: goreleaser/goreleaser-action@v6 with: version: latest - args: release --clean + args: release --clean --timeout=60m env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CLOUDSMITH_TOKEN: ${{ secrets.CLOUDSMITH_TOKEN }} TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} SCOOP_GITHUB_TOKEN: ${{ secrets.SCOOP_GITHUB_TOKEN }} - WINGET_GITHUB_TOKEN: ${{ secrets.WINGET_GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d7fc500..5841f3e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,15 +1,15 @@ version: 2 -project_name: hottgo +project_name: hg before: hooks: - go mod tidy builds: - - id: hottgo - main: ./cmd/hottgo - binary: hottgo + - id: hg + main: ./cmd/hg + binary: hg env: - CGO_ENABLED=0 goos: [linux, windows, darwin] @@ -20,24 +20,22 @@ builds: archives: - id: unix-tarballs - builds: [hottgo] + builds: [hg] format: tar.gz - # linux/darwin end up here wrap_in_directory: false files: - LICENSE - README.md - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + name_template: "hg_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - id: windows-zips - builds: [hottgo] + builds: [hg] format: zip - # windows ends up here automatically wrap_in_directory: false files: - LICENSE - README.md - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + name_template: "hg_{{ .Version }}_{{ .Os }}_{{ .Arch }}" checksum: name_template: "checksums.txt" @@ -55,26 +53,11 @@ release: draft: false prerelease: false -# Generate deb/rpm via nfpm (optional but useful for apt/yum repos) -nfpms: - - id: linux-packages - package_name: hottgo - file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}" - builds: [hottgo] - vendor: watchthelight - maintainer: "watchthelight " - license: MIT - homepage: "https://github.com/watchthelight/HypergraphGo" - description: "Hypergraph & HoTT tooling in Go" - formats: [deb, rpm] - bindir: /usr/bin - -# Homebrew (formula in your tap) brews: - - name: hottgo + - name: hg repository: - owner: watchthelight - name: homebrew-hottgo + owner: TODO + name: TODO token: "{{ .Env.TAP_GITHUB_TOKEN }}" commit_author: name: watchthelight-bot @@ -83,15 +66,17 @@ brews: homepage: "https://github.com/watchthelight/HypergraphGo" license: "MIT" install: | - bin.install "hottgo" + bin.install "hg" -# Upload built artifacts + packages to Cloudsmith -publishers: - - name: cloudsmith - # Requires CLOUDSMITH_TOKEN env set in CI - cmd: > - cloudsmith push raw watchthelight/hottgo - --name "{{ .ArtifactName }}" - --version "{{ .Version }}" - "{{ .ArtifactPath }}" - ids: ["all"] +scoops: + - name: hg + repository: + owner: TODO + name: TODO + token: "{{ .Env.SCOOP_GITHUB_TOKEN }}" + commit_author: + name: watchthelight-bot + email: admin@watchthelight.org + description: "Hypergraph & HoTT tooling in Go" + homepage: "https://github.com/watchthelight/HypergraphGo" + license: "MIT" From 6b756bee7b4dfb35cad5f317f023ad9a337b5f69 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 20:52:40 -0500 Subject: [PATCH 02/12] feat: prepare for release automation - update .gitignore and add license/todo --- .gitignore | Bin 773 -> 956 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index b10f0a1f7d1ed60eb6c62a913f7e15866f0cdead..b15ef39425cac0bbc0824762106f6eb1e9ced3f6 100644 GIT binary patch delta 11 ScmZo=+rz$rm3gus({=zAzyqNG delta 7 OcmdnP-paOtl^FmEBLW8i From 6021211e4b46806112dcf8cfb27bb446aa0d6804 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 20:56:47 -0500 Subject: [PATCH 03/12] ci(release): include LICENSE* in archives + use go-version-file --- .github/workflows/release.yml | 2 +- .goreleaser.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5dddc5f..d4e28a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: 'go.mod' - uses: goreleaser/goreleaser-action@v6 with: version: latest diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5841f3e..199598b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -24,7 +24,7 @@ archives: format: tar.gz wrap_in_directory: false files: - - LICENSE + - LICENSE* - README.md name_template: "hg_{{ .Version }}_{{ .Os }}_{{ .Arch }}" @@ -33,7 +33,7 @@ archives: format: zip wrap_in_directory: false files: - - LICENSE + - LICENSE* - README.md name_template: "hg_{{ .Version }}_{{ .Os }}_{{ .Arch }}" From fddad1d3b8a4ced7f7b97300209571d8d1ea389b Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:04:32 -0500 Subject: [PATCH 04/12] feat: prepare for release automation - update .gitignore and add license/todo --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 199598b..d260434 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,7 +16,7 @@ builds: goarch: [amd64, arm64] ldflags: - -s -w - mod_timestamp: "{{ .CommitDate }}" + mod_timestamp: "{{ .CommitTimestamp }}" archives: - id: unix-tarballs From 66d14ae651df3602f7fcc075713ceeaebb17b7f1 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:13:37 -0500 Subject: [PATCH 05/12] fix(goreleaser): scope Homebrew formula to unix-tarballs archive --- .goreleaser.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d260434..abb4818 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -55,6 +55,7 @@ release: brews: - name: hg + ids: [unix-tarballs] repository: owner: TODO name: TODO From 2040c8b0a9fe326ec34ec1c3affbbda25247ca34 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:17:30 -0500 Subject: [PATCH 06/12] fix(goreleaser): scope Scoop manifest to windows-zips archive --- .goreleaser.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index abb4818..3ec0afd 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -71,6 +71,7 @@ brews: scoops: - name: hg + ids: [windows-zips] repository: owner: TODO name: TODO From c9ddd6820d5574f80f578493d544b0d144b35193 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:29:54 -0500 Subject: [PATCH 07/12] ci(goreleaser): disable brew/scoop uploads until taps exist --- .goreleaser.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3ec0afd..469ac42 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -56,6 +56,7 @@ release: brews: - name: hg ids: [unix-tarballs] + skip_upload: true repository: owner: TODO name: TODO @@ -72,6 +73,7 @@ brews: scoops: - name: hg ids: [windows-zips] + skip_upload: true repository: owner: TODO name: TODO From def2ea0ab8fdb7391b78d1a32b3898da02183edd Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:32:16 -0500 Subject: [PATCH 08/12] fix(choco): dynamically resolve artifact name from checksums.txt --- .../chocolatey/{hottgo.nuspec => hg.nuspec} | 6 +++--- .../chocolatey/tools/chocolateyinstall.ps1.tmpl | 2 +- scripts/gen-choco.ps1 | 17 ++++++++++------- 3 files changed, 14 insertions(+), 11 deletions(-) rename packaging/chocolatey/{hottgo.nuspec => hg.nuspec} (87%) diff --git a/packaging/chocolatey/hottgo.nuspec b/packaging/chocolatey/hg.nuspec similarity index 87% rename from packaging/chocolatey/hottgo.nuspec rename to packaging/chocolatey/hg.nuspec index e01ff31..a1cf9b2 100644 --- a/packaging/chocolatey/hottgo.nuspec +++ b/packaging/chocolatey/hg.nuspec @@ -1,15 +1,15 @@ - hottgo + hg __REPLACE__ - hottgo + hg watchthelight watchthelight https://github.com/watchthelight/HypergraphGo/blob/main/LICENSE https://github.com/watchthelight/HypergraphGo false - hottgo is a CLI tool for Hypergraph operations. + hg is a CLI tool for Hypergraph operations. CLI tool for Hypergraph https://github.com/watchthelight/HypergraphGo/releases Copyright 2025 watchthelight diff --git a/packaging/chocolatey/tools/chocolateyinstall.ps1.tmpl b/packaging/chocolatey/tools/chocolateyinstall.ps1.tmpl index 4e8546f..f7d3fc2 100644 --- a/packaging/chocolatey/tools/chocolateyinstall.ps1.tmpl +++ b/packaging/chocolatey/tools/chocolateyinstall.ps1.tmpl @@ -2,7 +2,7 @@ $ErrorActionPreference = 'Stop' $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$url = 'https://github.com/watchthelight/HypergraphGo/releases/download/v$version$/hottgo_$version$_Windows_amd64.zip' +$url = 'https://github.com/watchthelight/HypergraphGo/releases/download/v$version$/$zipName$' $checksum = '$sha256_amd64$' diff --git a/scripts/gen-choco.ps1 b/scripts/gen-choco.ps1 index f38700f..31fbbd7 100644 --- a/scripts/gen-choco.ps1 +++ b/scripts/gen-choco.ps1 @@ -15,15 +15,18 @@ try { $lines = $checksums -split "`n" $checksum = $null +$zipName = $null foreach ($line in $lines) { - if ($line -match "hottgo_${Version}_Windows_amd64\.zip") { - $checksum = ($line -split " ")[0] + if ($line -match "_windows_amd64\.zip$") { + $parts = $line -split " " + $checksum = $parts[0] + $zipName = $parts[1] break } } -if (-not $checksum) { - Write-Error "Checksum for hottgo_${Version}_Windows_amd64.zip not found" +if (-not $checksum -or -not $zipName) { + Write-Error "Checksum for Windows amd64 zip not found in checksums.txt" exit 1 } @@ -31,11 +34,11 @@ $templatePath = "packaging/chocolatey/tools/chocolateyinstall.ps1.tmpl" $installScriptPath = "packaging/chocolatey/tools/chocolateyinstall.ps1" $template = Get-Content $templatePath -Raw -$installScript = $template -replace '\$version\$', $Version -replace '\$sha256_amd64\$', $checksum +$installScript = $template -replace '\$version\$', $Version -replace '\$sha256_amd64\$', $checksum -replace '\$zipName\$', $zipName Set-Content $installScriptPath $installScript # Update nuspec version -$nuspecPath = "packaging/chocolatey/hottgo.nuspec" +$nuspecPath = "packaging/chocolatey/hg.nuspec" $nuspec = Get-Content $nuspecPath -Raw $nuspec = $nuspec -replace '__REPLACE__', $Version Set-Content $nuspecPath $nuspec @@ -44,7 +47,7 @@ Set-Content $nuspecPath $nuspec choco pack $nuspecPath # Push -$nupkg = "hottgo.$Version.nupkg" +$nupkg = "hg.$Version.nupkg" if (Test-Path $nupkg) { choco push $nupkg --api-key $env:CHOCOLATEY_API_KEY } else { From 634a668b01f808e32791dde2df34e7498e0b5fa7 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:35:06 -0500 Subject: [PATCH 09/12] feat: prepare for release automation - update .gitignore and add license/todo --- .gitignore | Bin 956 -> 1139 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index b15ef39425cac0bbc0824762106f6eb1e9ced3f6..60feec9b9b6c58f459a24cdf205c82f0f42b1d32 100644 GIT binary patch delta 11 ScmdnP{+VOL9_Goc%-aDSj|6}K delta 7 Ocmey&v4?%b9%cXzF9R+B From 94f1c9bef7f2763fcbe31fed20f58a2afe02e652 Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:40:25 -0500 Subject: [PATCH 10/12] fix(choco): dynamically resolve Windows zip from checksums.txt --- scripts/gen-choco.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/gen-choco.ps1 b/scripts/gen-choco.ps1 index 31fbbd7..40206e6 100644 --- a/scripts/gen-choco.ps1 +++ b/scripts/gen-choco.ps1 @@ -30,6 +30,8 @@ if (-not $checksum -or -not $zipName) { exit 1 } +Write-Host "Found Windows amd64 zip: $zipName with checksum: $checksum" + $templatePath = "packaging/chocolatey/tools/chocolateyinstall.ps1.tmpl" $installScriptPath = "packaging/chocolatey/tools/chocolateyinstall.ps1" From 959ca0d19a4ecb4b86fd7c578db5379b947cc1cd Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:46:04 -0500 Subject: [PATCH 11/12] fix(goreleaser): normalize Windows archive naming for Chocolatey --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 469ac42..74564b7 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -35,7 +35,7 @@ archives: files: - LICENSE* - README.md - name_template: "hg_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + name_template: "hg_{{ .Version }}_windows_{{ .Arch }}" checksum: name_template: "checksums.txt" From ff325328a01e40bb0439a39b1fc5729af35d7c1f Mon Sep 17 00:00:00 2001 From: Bash Date: Sat, 13 Sep 2025 21:47:21 -0500 Subject: [PATCH 12/12] feat: prepare for release automation - update .gitignore and add license/todo --- .gitignore | Bin 1139 -> 688 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 60feec9b9b6c58f459a24cdf205c82f0f42b1d32..f4b900a6ced7756014329b12dbd0072e596762f9 100644 GIT binary patch literal 688 zcmZ8f!D<{a488j+1ihpoI|KQIvZWLPg>3G@V{1Gj9?RI8ooo*M_R5|XN-nbXWIahw z{zl0b!U{7N$c00(YXzG;1>bIA_It)C6EC_+Y@fC{=2*Mm6pk{P5le012U|%r7R?)*wvcMAw{ycwI zvYw>P&J?k+o-t$cnA{CK6?DRVq`QKv()Uu1*A#g>qRNiye!)~)xmd7pIAlcsvPUE#VvHz_kp8L!OgV35dRt0Ktp>aS<(xgU3FLh3aElR#3i(0H`wJpt5 z%?2&WBFS7q&+ewk2^R!CKnyQAddpc1{RN*I3zjEIxMpJ;+74z;S7h7Tz!iP yO~lfoVTuBYA5pfPN&D1*x_sV(XKh8n@{A