Skip to content

Commit

Permalink
Use goreleaser
Browse files Browse the repository at this point in the history
goreleaser is a tool for releasing go projects - https://goreleaser.com/

It will package things up for multiple platforms, and even publish to Github.
  • Loading branch information
slai committed Jan 3, 2019
1 parent dd41d2d commit e566c22
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
go-minipypi
dist/
38 changes: 38 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# you may remove this if you don't use vgo
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- freebsd
- windows
goarch:
- amd64
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
Expand All @@ -16,6 +17,12 @@ type Configs struct {
S3configs S3configs
}

var (
version = "dev"
commit = "none"
date = "unknown"
)

func genConfig(filename string) {
cfg := &Configs{
WebConfigs: WebServerConfigs{
Expand All @@ -38,6 +45,8 @@ func genConfig(filename string) {
}

func main() {
fmt.Printf("go-minipypi - %v, commit %v, built at %v\n", version, commit, date)

cfg := Configs{}

var configFile = flag.String("config", "config.yml", "config file")
Expand Down

0 comments on commit e566c22

Please sign in to comment.