diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4387c43..d4e28a8 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-file: 'go.mod' - 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/.gitignore b/.gitignore index b10f0a1..f4b900a 100644 Binary files a/.gitignore and b/.gitignore differ diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d7fc500..74564b7 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,43 +1,41 @@ 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] goarch: [amd64, arm64] ldflags: - -s -w - mod_timestamp: "{{ .CommitDate }}" + mod_timestamp: "{{ .CommitTimestamp }}" archives: - id: unix-tarballs - builds: [hottgo] + builds: [hg] format: tar.gz - # linux/darwin end up here wrap_in_directory: false files: - - LICENSE + - 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 + - LICENSE* - README.md - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + name_template: "hg_{{ .Version }}_windows_{{ .Arch }}" checksum: name_template: "checksums.txt" @@ -55,26 +53,13 @@ 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 + ids: [unix-tarballs] + skip_upload: true repository: - owner: watchthelight - name: homebrew-hottgo + owner: TODO + name: TODO token: "{{ .Env.TAP_GITHUB_TOKEN }}" commit_author: name: watchthelight-bot @@ -83,15 +68,19 @@ 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 + ids: [windows-zips] + skip_upload: true + 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" 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..40206e6 100644 --- a/scripts/gen-choco.ps1 +++ b/scripts/gen-choco.ps1 @@ -15,27 +15,32 @@ 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 } +Write-Host "Found Windows amd64 zip: $zipName with checksum: $checksum" + $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 +49,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 {