From c4b49646b941787d9abb16805252298f1d488538 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 27 Nov 2018 09:39:23 -0800 Subject: [PATCH] Add separate gorelease configs for windows and packages --- .goreleaser-packages.yml | 52 +++++++++++++++++++++++++++++++++ .goreleaser-windows.yml | 24 +++++++++++++++ .goreleaser.yml | 63 ++++------------------------------------ 3 files changed, 81 insertions(+), 58 deletions(-) create mode 100644 .goreleaser-packages.yml create mode 100644 .goreleaser-windows.yml diff --git a/.goreleaser-packages.yml b/.goreleaser-packages.yml new file mode 100644 index 00000000..61a82024 --- /dev/null +++ b/.goreleaser-packages.yml @@ -0,0 +1,52 @@ +project_name: 'geoipupdate' +archive: + wrap_in_directory: true + files: + - 'CHANGELOG.md' + - 'LICENSE-APACHE' + - 'LICENSE-MIT' + - 'README.md' + - 'GeoIP.conf' + - 'GeoIP.conf.md' + - 'geoipupdate.md' +builds: +- main: './cmd/geoipupdate' + binary: 'geoipupdate' + goarch: + - '386' + - 'amd64' + goos: + - 'darwin' + - 'linux' + hooks: + post: 'make data BUILDDIR=. CONFFILE=/etc/GeoIP.conf DATADIR=/usr/share/GeoIP' + ldflags: + - '-s -w -X main.version={{.Version}} -X main.defaultConfigFile=/etc/GeoIP.conf -X main.defaultDatabaseDirectory=/usr/share/GeoIP' +checksum: + name_template: 'checksums-dpkg-rpm.txt' +nfpm: + vendor: 'MaxMind, Inc.' + homepage: https://www.maxmind.com/ + maintainer: 'MaxMind, Inc. ' + description: Program to perform automatic updates of GeoIP2 and GeoIP Legacy binary databases. + license: Apache 2.0 or MIT + formats: + - deb + - rpm + bindir: /usr/bin + empty_folders: + - /usr/share/GeoIP + files: + 'CHANGELOG.md': '/usr/share/doc/geoipupdate/CHANGELOG.md' + 'LICENSE-APACHE': '/usr/share/doc/geoipupdate/LICENSE-APACHE' + 'LICENSE-MIT': '/usr/share/doc/geoipupdate/LICENSE-MIT' + 'README.md': '/usr/share/doc/geoipupdate/README.md' + 'GeoIP.conf': '/usr/share/doc/geoipupdate/GeoIP.conf' + 'GeoIP.conf.md': '/usr/share/doc/geoipupdate/GeoIP.conf.md' + 'geoipupdate.md': '/usr/share/doc/geoipupdate/geoipupdate.md' + config_files: + 'GeoIP.conf': '/etc/GeoIP.conf' +release: + # We disable the release as there is no way to disable the creation of + # the archive version and we don't want to upload those. + disable: true diff --git a/.goreleaser-windows.yml b/.goreleaser-windows.yml new file mode 100644 index 00000000..5876ec99 --- /dev/null +++ b/.goreleaser-windows.yml @@ -0,0 +1,24 @@ +project_name: 'geoipupdate' +archive: + wrap_in_directory: true + files: + - 'CHANGELOG.md' + - 'LICENSE-APACHE' + - 'LICENSE-MIT' + - 'README.md' + - 'GeoIP.conf' + - 'GeoIP.conf.md' + - 'geoipupdate.md' + format: zip +builds: +- main: './cmd/geoipupdate' + binary: 'geoipupdate' + goarch: + - '386' + - 'amd64' + goos: + - 'windows' + hooks: + post: 'make data OS=Windows_NT BUILDDIR=.' +checksum: + name_template: 'checksums-windows.txt' diff --git a/.goreleaser.yml b/.goreleaser.yml index 3c2f82ae..2d2e45bc 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,71 +7,18 @@ archive: - 'LICENSE-MIT' - 'README.md' - 'GeoIP.conf' - format_overrides: - - goos: windows - format: zip + - 'GeoIP.conf.md' + - 'geoipupdate.md' builds: -- main: './cmd/geoipupdate' - binary: 'geoipupdate' - goarch: - - 'amd64' - goos: - - 'darwin' - hooks: - post: 'make data BUILDDIR=dist/darwin_amd64' - main: './cmd/geoipupdate' binary: 'geoipupdate' goarch: - '386' - goos: - - 'linux' - hooks: - post: 'make data BUILDDIR=dist/linux_386' -- main: './cmd/geoipupdate' - binary: 'geoipupdate' - goarch: - 'amd64' goos: + - 'darwin' - 'linux' hooks: - post: 'make data BUILDDIR=dist/linux_amd64' -- main: './cmd/geoipupdate' - binary: 'geoipupdate' - goarch: - - '386' - goos: - - 'windows' - hooks: - post: 'make data OS=Windows_NT BUILDDIR=dist/windows_386' -- main: './cmd/geoipupdate' - binary: 'geoipupdate' - goarch: - - 'amd64' - goos: - - 'windows' - hooks: - post: 'make data OS=Windows_NT BUILDDIR=dist/windows_amd64' + post: 'make data BUILDDIR=.' checksum: - name_template: 'checksums.txt' -nfpm: - vendor: 'MaxMind, Inc.' - homepage: https://www.maxmind.com/ - maintainer: 'MaxMind, Inc. ' - description: Program to perform automatic updates of GeoIP2 and GeoIP Legacy binary databases. - license: Apache 2.0 or MIT - formats: - - deb - - rpm - bindir: /usr/bin - empty_folders: - - /usr/share/GeoIP - files: - 'CHANGELOG.md': '/usr/share/doc/geoipupdate/CHANGELOG.md' - 'LICENSE-APACHE': '/usr/share/doc/geoipupdate/LICENSE-APACHE' - 'LICENSE-MIT': '/usr/share/doc/geoipupdate/LICENSE-MIT' - 'README.md': '/usr/share/doc/geoipupdate/README.md' - 'GeoIP.conf': '/usr/share/doc/geoipupdate/GeoIP.conf' - 'GeoIP.conf.md': '/usr/share/doc/geoipupdate/GeoIP.conf.md' - 'geoipupdate.md': '/usr/share/doc/geoipupdate/geoipupdate.md' - config_files: - 'GeoIP.conf': '/etc/GeoIP.conf' + name_template: 'checksums-darwin-linux.txt'