Goreleaser: Support custom publishers

Created on 20 Apr 2020  路  4Comments  路  Source: goreleaser/goreleaser

Currently there is many publishers available:

https://github.com/goreleaser/goreleaser/blob/5f2cf501e85d139c8a48ad9ec79cdc874b4c89ce/internal/pipe/publish/publish.go#L38-L42

while the HTTP Upload publisher looks fairly universal, it could be a lot of effort to publish to a custom, authenticated API endpoint, or even publish to a known endpoint (like S3) in a more opinionated/complex way (e.g. setting some extra HTTP headers for each object).

For that reason I'd like to propose creation of a custom publisher, which could offer more or less the same interface as the new build hooks, e.g.

publishers:
  -
    # Unique name of your publisher. Used for identification
    name: "custom"

    # IDs of the artifacts you want to publish
    ids:
     - foo
     - bar

    # Publish checksums (defaults to false)
    checksum: true

    # Publish signatures (defaults to false)
    signature: true

    # Working directory in which to execute the command
    dir: "/utils"

    # Command to be executed
    cmd: custom-publisher.sh -product={{ .ProjectName }} -version={{ .Version }} {{ .ArtifactName }}

    # Environment variables
    env:
      - API_TOKEN=secret-token

I'm willing to implement this, if there is agreement on the idea and direction in general.

enhancement

Most helpful comment

FYI: I just updated the example config snippet above as I'm working through the prototype. I will hopefully have a PR very 馃敎

All 4 comments

(this was not meant to be labelled as bug - I just picked a wrong template)

I think its OK if we have the interface well-defined :)

Would like a PR for sure ;)

FYI: I just updated the example config snippet above as I'm working through the prototype. I will hopefully have a PR very 馃敎

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings