Skip to content

Hacking support for Rust (not related to previous efforts) #962

@jondot

Description

@jondot

Hi all,
Just wanted to let you know that I managed to hack support for rust, without modifying the goreleaser code or doing anything that's mentioned in any of #520, #496, #522.

Here's my configuration:

project_name: cep
builds:
  -
    main: dummy.go
    goarch:
      - amd64
    binary: cep
    hooks:
      post: sh build-cross-release.sh
archive:
  replacements:
    darwin: Darwin
    linux: Linux
    windows: Windows
    386: i386
    amd64: x86_64
checksum:
  name_template: 'checksums.txt'
release:
  disable: true

By simply providing it with a dummy.go and doing all the hard Rust build work in build-cross-release.sh, which includes:

mkdir -p dist/darwin_amd64 && cp target/x86_64-apple-darwin/release/cep dist/darwin_amd64
mkdir -p dist/linux_amd64 && cp target/x86_64-unknown-linux-gnu/release/cep dist/linux_amd64

And so I kind of "cheat" GoReleaser into thinking it did those builds. It will then carry on with the rest of the pipeline happily.

Hope to provoke that there isn't really a very intimate build support needed for Rust, or for that matter any language -- just the ability to provide a shell script, and to copy artifacts in a predictable manner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsA problem or enhancement in documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions