Skip to content

Commit

Permalink
Adds initial goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
TekWizely committed Jan 6, 2020
1 parent 3792b87 commit 0c9ebbe
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Runfile
*.run
*.rf

# ==============================================================================
# Build Assets
# ==============================================================================

# GoReleaser
dist/

# ==============================================================================
# GoLang
# ==============================================================================
Expand Down
97 changes: 97 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# See documentation
#
# http://goreleaser.com
#
# Usage:
#
# GIT_SUMMARY=$(git describe --tags --dirty --always) goreleaser
#
project_name: run
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
binary: run
ldflags:
- -s -w -X "main.Version={{.Version}}" -X "main.BuildDate={{.Date}}" -X "main.GitSummary={{.Env.GIT_SUMMARY}}" -X "main.BuildTool=goreleaser"
goos:
- darwin
- linux
goarch:
- amd64
archives:
- replacements:
darwin: Darwin
linux: Linux
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}"
changelog:
sort:
filters:
exclude:
- '^docs:'
- '^test:'
release:
draft: true
github:
owner: TekWizely
name: run
brews:
- name: run
github:
owner: TekWizely
name: run

# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: TekWizely
email: TekWize.ly@gmail.com

# Folder inside the repository to put the formula.
# Default is the root folder.
folder: Formula

# Your app's homepage.
# Default is empty.
homepage: "https://github.com/TekWizely/run"

# Your app's description.
# Default is empty.
description: "Easily manage and invoke small scripts and wrappers"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: true

# Packages your package depends on.
dependencies:
- go

# So you can `brew test` your formula.
# Default is empty.
test: |
text = "Hello Homebrew!"
task = "hello"
(testpath/"Runfile").write <<~EOS
#{task}:
echo #{text}
EOS
assert_equal text, shell_output("#{bin}/#{name} #{task}").chomp
# Custom install script for brew.
# Default is 'bin.install "program"'.
install: |
system "go", "build", "-trimpath", "-ldflags", "-w -s -X main.BuildTool=brew via tekwizely/tap/run", "-o", bin/name

0 comments on commit 0c9ebbe

Please sign in to comment.