From 095796c8a16116340d4e70f91457eb60b12374e4 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 17 Dec 2017 11:19:53 -0800 Subject: [PATCH 1/5] Default config from `goreleaser init` --- .gitignore | 1 + .goreleaser.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .goreleaser.yml diff --git a/.gitignore b/.gitignore index 0cd2d89..8a701bd 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ _testmain.go # our binaries /inbucket /inbucket.exe +/dist/** /target/** /cmd/client/client /cmd/client/client.exe diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..04115f1 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,49 @@ +release: + github: + owner: 'https:' + name_template: '{{.Tag}}' +brew: + commit_author: + name: goreleaserbot + email: goreleaser@carlosbecker.com + install: bin.install "" +builds: + - goos: + - linux + - darwin + goarch: + - amd64 + - "386" + goarm: + - "6" + main: . + ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} +archive: + format: tar.gz + name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ + .Arm }}{{ end }}' + files: + - licence* + - LICENCE* + - license* + - LICENSE* + - readme* + - README* + - changelog* + - CHANGELOG* +fpm: + bindir: /usr/local/bin +snapshot: + name_template: SNAPSHOT-{{ .Commit }} +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' +dist: dist +sign: + cmd: gpg + args: + - --output + - $signature + - --detach-sig + - $artifact + signature: ${artifact}.sig + artifacts: none From 9f6dee640e43669d875812c12842b10cc3ebd13a Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 17 Dec 2017 19:10:59 -0800 Subject: [PATCH 2/5] Customize goreleaser to get a working build --- .goreleaser.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 04115f1..96394a0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,8 @@ +project_name: inbucket release: github: - owner: 'https:' + owner: jhillyerd + name: inbucket name_template: '{{.Tag}}' brew: commit_author: @@ -8,29 +10,33 @@ brew: email: goreleaser@carlosbecker.com install: bin.install "" builds: - - goos: - - linux + - binary: inbucket + goos: - darwin + - freebsd + - linux + - windows goarch: - amd64 - - "386" goarm: - "6" - main: . + main: inbucket.go 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: - - licence* - - LICENCE* - - license* - LICENSE* - - readme* - README* - - changelog* - CHANGELOG* + - inbucket.bat + - etc/**/* + - themes/**/* fpm: bindir: /usr/local/bin snapshot: From 890d8e0202d0e3381bfdf59375e05d4df5c4b0c7 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 17 Dec 2017 19:32:05 -0800 Subject: [PATCH 3/5] Rename link variables, setup travis tag releases --- .goreleaser.yml | 7 ------- .travis.yml | 3 +++ inbucket.go | 12 ++++++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 96394a0..4d765f7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -45,11 +45,4 @@ checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' dist: dist sign: - cmd: gpg - args: - - --output - - $signature - - --detach-sig - - $artifact - signature: ${artifact}.sig artifacts: none 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/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 { From a457b656033993bc8b28f2cc55a49ed435fa10fd Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 17 Dec 2017 20:05:07 -0800 Subject: [PATCH 4/5] Add cmd/client to release builds --- .goreleaser.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 4d765f7..f8fe52c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -20,7 +20,19 @@ builds: - amd64 goarm: - "6" - main: inbucket.go + 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 From 6f57c51934e7f93ffd7800caffea3e932c529bea Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 17 Dec 2017 20:13:14 -0800 Subject: [PATCH 5/5] Update release procedures, cleanup goxc config --- .gitignore | 4 ---- .goxc.json | 18 ------------------ CHANGELOG.md | 13 ++++++------- 3 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 .goxc.json diff --git a/.gitignore b/.gitignore index 8a701bd..52aeb50 100644 --- a/.gitignore +++ b/.gitignore @@ -29,9 +29,5 @@ _testmain.go /inbucket /inbucket.exe /dist/** -/target/** /cmd/client/client /cmd/client/client.exe - -# local goxc config -.goxc.local.json 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/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.