Build a repository of releases built with goreleaser.
Go to file
2024-10-07 23:49:47 -05:00
.github/workflows First commit 2024-10-07 23:49:47 -05:00
tests First commit 2024-10-07 23:49:47 -05:00
.gitignore First commit 2024-10-07 23:49:47 -05:00
.goreleaser.yaml First commit 2024-10-07 23:49:47 -05:00
add_release_cmd.go First commit 2024-10-07 23:49:47 -05:00
flags.go First commit 2024-10-07 23:49:47 -05:00
go.mod First commit 2024-10-07 23:49:47 -05:00
go.sum First commit 2024-10-07 23:49:47 -05:00
goreleaser.go First commit 2024-10-07 23:49:47 -05:00
LICENSE.txt First commit 2024-10-07 23:49:47 -05:00
main_test.go First commit 2024-10-07 23:49:47 -05:00
main.go First commit 2024-10-07 23:49:47 -05:00
manifest.go First commit 2024-10-07 23:49:47 -05:00
prune_cmd.go First commit 2024-10-07 23:49:47 -05:00
README.md First commit 2024-10-07 23:49:47 -05:00
util.go First commit 2024-10-07 23:49:47 -05:00

goreleaser-http-repo-builder

This tool was written out of the need to build a release repository compatible with go-selfupdate with releases built by goreleaser.

Example Usage

The command has extensive help available, the following is an example of building a release and adding it to a new repo.

goreleaser release --snapshot --skip=publish
mkdir repo
goreleaser-http-repo-builder add-release --repo=repo/ --release=dist/

After adding a release, you can copy the repo to your web server for update distrobution.

Example Goreleaser Config

While there is good documentation available that I'd recommend reading, the following provides some examples that may be helpful in generating a release that is compatible with go-selfupdate.

  • The checksums file name defaults to preappend the project name, which is not compatible if you wish to use the checksums to verify an update.
  • If you're signing releases with an ECDSA key, this is what I found works best.
  • If you need to specify the version manually, you can edit the version template. By default, goreleaser will use the git tag to determine the version.
version: 2

before:
  hooks:
    - go mod tidy

builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - linux
    goarch:
      - amd64
      - arm64

archives:
  - format: tar.gz
    name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
    wrap_in_directory: true

checksum:
    name_template: "checksums.txt"

signs:
  - artifacts: all
    cmd: openssl
    args:
        - dgst
        - -sha256
        - -sign
        - "signing.key"
        - -out
        - ${signature}
        - ${artifact}

snapshot:
    version_template: "v0.1.2"