From 7f06f25c1534d400c53f0ca86f0182819c9e201a Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 7 Jan 2018 12:21:44 +1000 Subject: [PATCH] Start making builds with goreleaser --- .gitignore | 1 + .goreleaser.yml | 44 +++++++++++++++++++++++++++++++++++++ Makefile | 50 ++++--------------------------------------- docs/README => README | 0 4 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 .goreleaser.yml rename docs/README => README (100%) diff --git a/.gitignore b/.gitignore index f13997b2..896b8dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,4 @@ _testmain.go _test oragono.prof oragono.mprof +/dist diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..b902ff6d --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,44 @@ +# .goreleaser.yml +# Build customization +project_name: oragono +builds: + - main: oragono.go + binary: oragono + goos: + - freebsd + - windows + - darwin + - linux + goarch: + - amd64 + - arm + - arm64 + goarm: + - 6 + - 7 + ignore: + - goos: windows + goarch: arm + - goos: darwin + goarch: arm + - goos: freebsd + goarch: arm + - goos: freebsd + goarch: arm64 +archive: + name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}{{ if .Arm }}-{{ .Arch }}v{{ .Arm }}{{ end }}" + format: tar.gz + replacements: + amd64: x64 + darwin: osx + format_overrides: + - goos: windows + format: zip + files: + - README + - CHANGELOG.md + - oragono.motd + - oragono.yaml + - docs/* +checksum: + name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt" diff --git a/Makefile b/Makefile index 87bd3dd8..0e1af074 100644 --- a/Makefile +++ b/Makefile @@ -1,55 +1,13 @@ -BUILD=./build -WIN=$(BUILD)/win -LINUX=$(BUILD)/linux -OSX=$(BUILD)/osx -ARM6=$(BUILD)/arm -SOURCE=oragono.go -VERS=XXX +.PHONY: all clean build -.PHONY: all clean windows osx linux arm6 - -add-files = mkdir -p $1; \ - cp oragono.yaml $1; \ - cp oragono.motd $1; \ - cp LICENSE $1; \ - cp ./docs/README $1; \ - mkdir -p $1/docs; \ - cp ./CHANGELOG.md $1/docs/; \ - cp ./docs/*.md $1/docs/; \ - cp ./docs/logo* $1/docs/; - -all: clean windows osx linux arm6 +all: clean build clean: rm -rf $(BUILD) mkdir -p $(BUILD) -windows: - GOOS=windows GOARCH=amd64 go build $(SOURCE) - $(call add-files,$(WIN)) - mv oragono.exe $(WIN) - cd $(WIN) && zip -r ../oragono-$(VERS)-windows.zip * - -osx: - GOOS=darwin GOARCH=amd64 go build $(SOURCE) - $(call add-files,$(OSX)) - mv oragono $(OSX) - cd $(OSX) && tar -czvf ../oragono-$(VERS)-osx.tgz * - -linux: - GOOS=linux GOARCH=amd64 go build $(SOURCE) - $(call add-files,$(LINUX)) - mv oragono $(LINUX) - cd $(LINUX) && tar -czvf ../oragono-$(VERS)-linux.tgz * - -arm6: - GOARM=6 GOARCH=arm go build $(SOURCE) - $(call add-files,$(ARM6)) - mv oragono $(ARM6) - cd $(ARM6) && tar -czvf ../oragono-$(VERS)-arm.tgz * - -deps: - go get -v -d +build: + goreleaser --snapshot --rm-dist test: cd irc && go test . diff --git a/docs/README b/README similarity index 100% rename from docs/README rename to README