1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-29 01:44:39 +02:00
Deliver Go binaries as fast and easily as possible https://goreleaser.com/
Go to file
Carlos Alexandro Becker 756701b971
gitignore .glide
2017-01-21 19:23:32 -02:00
clients Merge branch 'master' into goreleaser.example.yml 2017-01-15 08:49:49 -02:00
config added brew dependencies support 2017-01-17 08:33:43 -02:00
context removed unneeded pointers from context 2017-01-18 15:08:48 -02:00
docs Update docs 2017-01-21 15:02:10 +01:00
pipeline improved error msg 2017-01-21 19:14:02 -02:00
sha256sum golint comments 2017-01-15 08:48:27 -02:00
.editorconfig added replacements support 2017-01-11 19:24:17 -02:00
.gitignore gitignore .glide 2017-01-21 19:23:32 -02:00
.travis.yml debug 2017-01-21 19:21:42 -02:00
CODE_OF_CONDUCT.md added code of conduct 2017-01-02 13:36:39 -02:00
CONTRIBUTING.md Update CONTRIBUTING.md 2017-01-17 10:47:34 -02:00
glide.lock renamed package 2017-01-14 20:01:32 -02:00
glide.yaml renamed package 2017-01-14 20:01:32 -02:00
goreleaser.yml Remove goreleaser example file 2017-01-21 15:34:00 +01:00
LICENSE.md readme, license and shit 2016-12-28 22:55:23 -02:00
main.go dont git stash or checkout, just fail 2017-01-21 19:11:54 -02:00
Makefile added fmt task to makefile, improved the rest 2017-01-15 09:11:37 -02:00
README.md Typo 2017-01-21 15:37:24 +01:00

GoReleaser

goreleaser

GoReleaser builds Go binaries for several platforms, creates a GitHub release and then pushes 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.

Release Software License Travis Go Report Card Powered By: GoReleaser

Why?

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.

Documentation

For Documentation, visit the GoReleaser website or our GitHub docs.

Usage

  • You need to export a GITHUB_TOKEN environment variable with the repo scope selected. You can create one here.

  • GoReleaser uses the latest Git tag of your repository, so you need to create a tag first.

  • Now you can run goreleaser at the root of your repository:

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

This will build main.go as binary, for Darwin and Linux (amd64 and i386), archive the binary and common files as .tar.gz, and finally, publish a new GitHub release in the repository with archives uploaded.

Of course, all this can be customized!

Customization

For customization create a goreleaser.yml file in the root of your repository.

A complete and commented example can be found in the documentation.

You can also check the goreleaser.yml used by GoReleaser itself.

A note about main.version

GoReleaser always sets a main.version ldflag. You can use it in your main.go file:

package main

var version = "master"

func main() {
  println(version)
}

And this version will always be the name of the current tag.

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/goreleaser"
  url "https://github.com/goreleaser/goreleaser/releases/download/v0.2.8/release_Darwin_x86_64.tar.gz"
  version "v0.2.8"
  sha256 "9ee30fc358fae8d248a2d7538957089885da321dca3f09e3296fe2058e7fff74"

  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)