From 09a90a322a07af7d6b8d0f2be58dd8190d560673 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 13 Oct 2018 10:19:43 -0600 Subject: [PATCH] add more package support --- goreleaser.yml | 111 ++++++++++++++++++++++++++++++++++++------------- main.go | 8 ++-- 2 files changed, 85 insertions(+), 34 deletions(-) diff --git a/goreleaser.yml b/goreleaser.yml index 9ce74f2..67604e6 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -1,34 +1,85 @@ -# .goreleaser.yml -# Build customization -builds: - - binary: croc - goos: - - windows - - darwin - - linux - goarch: - - amd64 - - arm - - 386 - goarm: - - 6 - ignore: - - goos: darwin - goarch: arm - - goos: windows - goarch: arm - - goos: darwin - goarch: 386 - env: - - CGO_ENABLED=0 -archive: +project_name: croc +build: + main: main.go + binary: croc + ldflags: -s -w -X main.Version="v{{.Version}}-{{.Date}}" + env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - windows + - freebsd + - netbsd + - openbsd + - dragonfly + goarch: + - amd64 + - 386 + - arm + - arm64 + goarm: + - 7 +snapcraft: + name: croc + summary: A simple, secure, and fast way to transfer data. + description: This allows you to transfer data between two computers as though they were on LAN. + grade: stable + confinement: strict replacements: amd64: 64bit 386: 32bit - darwin: OSX - linux_arm: raspberry_pi + arm: ARM + arm64: ARM64 + darwin: macOS + linux: Linux + windows: Windows + openbsd: OpenBSD + netbsd: NetBSD + freebsd: FreeBSD + dragonfly: DragonFlyBSD + +nfpm: + formats: + - deb + vendor: "schollz.com" + homepage: "https://github.com/schollz/croc" + maintainer: "Zack Scholl " + description: "A simple, secure, and fast way to transfer data." + license: "MIT" + name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}" + replacements: + amd64: 64bit + 386: 32bit + arm: ARM + arm64: ARM64 + darwin: macOS + linux: Linux + windows: Windows + openbsd: OpenBSD + netbsd: NetBSD + freebsd: FreeBSD + dragonfly: DragonFlyBSD +archive: + format: tar.gz format_overrides: - - goos: windows - format: zip - - goos: darwin - format: zip + - goos: windows + format: zip + name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}" + replacements: + amd64: 64bit + 386: 32bit + arm: ARM + arm64: ARM64 + darwin: macOS + linux: Linux + windows: Windows + openbsd: OpenBSD + netbsd: NetBSD + freebsd: FreeBSD + dragonfly: DragonFlyBSD + files: + - README.md + - LICENSE +release: + draft: true diff --git a/main.go b/main.go index d96b689..6b29377 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ import ( "github.com/urfave/cli" ) -var version string +var Version string var codePhrase string var cr *croc.Croc @@ -25,11 +25,11 @@ var cr *croc.Croc func main() { app := cli.NewApp() app.Name = "croc" - if version == "" { - version = "dev" + if Version == "" { + Version = "dev" } - app.Version = version + app.Version = Version app.Compiled = time.Now() app.Usage = "easily and securely transfer stuff from one computer to another" app.UsageText = "croc allows any two computers to directly and securely transfer files"