diff --git a/.gitignore b/.gitignore index 0cd2d89..52aeb50 100644 --- a/.gitignore +++ b/.gitignore @@ -28,9 +28,6 @@ _testmain.go # our binaries /inbucket /inbucket.exe -/target/** +/dist/** /cmd/client/client /cmd/client/client.exe - -# local goxc config -.goxc.local.json diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..f8fe52c --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,60 @@ +project_name: inbucket +release: + github: + owner: jhillyerd + name: inbucket + name_template: '{{.Tag}}' +brew: + commit_author: + name: goreleaserbot + email: goreleaser@carlosbecker.com + install: bin.install "" +builds: + - binary: inbucket + goos: + - darwin + - freebsd + - linux + - windows + goarch: + - amd64 + goarm: + - "6" + main: . + ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} + - binary: client + goos: + - darwin + - freebsd + - linux + - windows + goarch: + - amd64 + goarm: + - "6" + main: ./cmd/client + ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} +archive: + format: tar.gz + wrap_in_directory: true + name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ + .Arm }}{{ end }}' + format_overrides: + - goos: windows + format: zip + files: + - LICENSE* + - README* + - CHANGELOG* + - inbucket.bat + - etc/**/* + - themes/**/* +fpm: + bindir: /usr/local/bin +snapshot: + name_template: SNAPSHOT-{{ .Commit }} +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' +dist: dist +sign: + artifacts: none diff --git a/.goxc.json b/.goxc.json deleted file mode 100644 index b78010a..0000000 --- a/.goxc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ArtifactsDest": "target", - "TasksExclude": [ - "pkg-build" - ], - "Arch": "amd64", - "Os": "darwin freebsd linux windows", - "ResourcesInclude": "README*,LICENSE*,CHANGELOG*,inbucket.bat,etc,themes", - "PackageVersion": "1.2.0", - "PrereleaseInfo": "rc2", - "ConfigVersion": "0.9", - "BuildSettings": { - "LdFlagsXVars": { - "TimeNow": "main.BUILDDATE", - "Version": "main.VERSION" - } - } -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 59308ff..a407e1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,3 +9,6 @@ go: - 1.9.2 script: go test -race -v ./... + +after_success: + - test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f2972f..554bfd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,12 +108,11 @@ Release Checklist - Ensure *Unreleased* section is up to date - Rename *Unreleased* section to release name and date. - Add new GitHub `/compare` link -3. Update goxc version info: `goxc -wc -pv=1.x.0 -pr=rc1` -4. Run: `goxc interpolate-source` to update VERSION var -5. Run tests -6. Test cross-compile: `goxc` -7. Commit changes and merge release: `git flow release finish 1.x.0` -8. Upload to bintray: `goxc bintray` -9. Update `binary_versions` option in `inbucket-site/_config.yml` +3. Run tests +4. Test cross-compile: `goreleaser --snapshot` +5. Commit changes and merge release: `git flow release finish` +6. Push tags and wait for https://travis-ci.org/jhillyerd/inbucket build to + complete +7. Update `binary_versions` option in `inbucket-site/_config.yml` See http://keepachangelog.com/ for additional instructions on how to update this file. diff --git a/inbucket.go b/inbucket.go index 303e090..5d1c5ac 100644 --- a/inbucket.go +++ b/inbucket.go @@ -23,11 +23,11 @@ import ( ) var ( - // VERSION contains the build version number, populated during linking by goxc - VERSION = "1.2.0-rc2" + // version contains the build version number, populated during linking + version = "undefined" - // BUILDDATE contains the build date, populated during linking by goxc - BUILDDATE = "undefined" + // date contains the build date, populated during linking + date = "undefined" // Command line flags help = flag.Bool("help", false, "Displays this help") @@ -61,8 +61,8 @@ func init() { } func main() { - config.Version = VERSION - config.BuildDate = BUILDDATE + config.Version = version + config.BuildDate = date flag.Parse() if *help {