1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-04 03:11:55 +02:00
Deliver Go binaries as fast and easily as possible https://goreleaser.com/
Go to file
2017-01-11 14:02:57 -02:00
config config test 2017-01-06 13:37:09 -02:00
pipeline added sha256, removed head 2017-01-11 14:02:57 -02:00
sha256sum added sha256, removed head 2017-01-11 14:02:57 -02:00
split gofmt 2016-12-31 14:07:58 -02:00
uname gofmt 2016-12-31 14:07:58 -02:00
.editorconfig added editorconfig 2017-01-02 15:03:57 -02:00
.gitignore Reflect binary name from dirname 2016-12-30 17:30:44 +00:00
.travis.yml removed debug line 2017-01-02 14:33:26 -02:00
CODE_OF_CONDUCT.md added code of conduct 2017-01-02 13:36:39 -02:00
CONTRIBUTING.md Update go version prerequisite 2017-01-02 18:16:15 +01:00
glide.lock improved main.go 2016-12-31 13:57:39 -02:00
glide.yaml improved main.go 2016-12-31 13:57:39 -02:00
goreleaser.yml fix indent 2016-12-30 16:57:23 -02:00
LICENSE.md readme, license and shit 2016-12-28 22:55:23 -02:00
main.go added errcheck 2017-01-02 13:20:33 -02:00
Makefile tab 2017-01-02 14:31:14 -02:00
README.md Update README.md 2017-01-04 11:35:04 +02:00

GoReleaser Build Status Go Report Card Powered By: GoReleaser

Deliver Go binaries as fast and easily as possible.

GoReleaser builds Go binaries for several platforms, creates a github release and then push a homebrew formulae to a repository. All that wrapped in your favorite CI.

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to root@carlosbecker.com.

How it works?

The idea started with a simple shell script, but it quickly became more complex and I also wanted to publish binaries via homebrew.

So, the all-new goreleaser was born.

Usage

Create a goreleaser.yml file in the root of your repository. A minimal config would look like this:

repo: user/repo
binary_name: my-binary

You may then run releaser at the root of your repository:

curl -s https://raw.githubusercontent.com/goreleaser/get/master/latest | bash

This will build main.go file as my-binary, for Darwin and Linux, x86_64 and i386, packaging the binary, LICENSE.md and README.md and publish a new github release in the user/repo repository with the .tar.gz files there.

Homebrew

To push it to a homebrew repo, just add a brew section:

repo: user/repo
binary_name: my-binary
brew:
  repo: user/homebrew-formulae
  caveats: "Optional caveats to add to the formulae"

Build customization

Just add a build section

repo: user/repo
binary_name: my-binary
build:
  main: ./cmd/main.go
  oses:
    - darwin
    - freebsd
  arches:
    - amd64

oses and arches should be in GOOS/GOARCH-compatible format.

Add more files

You might also want to change the files that are packaged by adding a files section:

repo: user/repo
binary_name: my-binary
files:
  - LICENSE.txt
  - README.md
  - CHANGELOG.md

Wire it with travis-ci

You may want to wire this to auto-deploy your new tags on travis, for example:

after_success:
  test -n "$TRAVIS_TAG" && curl -s https://raw.githubusercontent.com/goreleaser/get/master/latest | bash

What the end result looks like

The release on github looks pretty much like this:

image

And the homebrew formulae would look like:

class Release < Formula
  desc "Deliver Go binaries as fast and easily as possible."
  homepage "https://github.com/goreleaser/releaser"
  url "https://github.com/goreleaser/releaser/releases/download/v0.2.0/release_#{%x(uname -s).gsub(/\n/, '')}_#{%x(uname -m).gsub(/\n/, '')}.tar.gz"
  head "https://github.com/goreleaser/releaser.git"
  version "v0.2.0"

  def install
    bin.install "release"
  end
end

How to contribute

Please refer to our contributing guidelines.

Badges

Feel free to use it in your own projects:

[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=flat-square)](https://github.com/goreleaser)