Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from dbarbuzzi/build-with-mage-goreleaser
Browse files Browse the repository at this point in the history
Build with Mage & Goreleaser
  • Loading branch information
dbarbuzzi authored Oct 16, 2018
2 parents 1efc876 + 5f5a85f commit 83f93fa
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 34 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.10

- image: circleci/golang:1.11
working_directory: /go/src/github.com/dbarbuzzi/tvd
steps:
- checkout

- run: go get -v -t -d ./...
- run: go test -v ./...
65 changes: 65 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
project_name: tvd
before:
hooks:
- bash .clientid
release:
github:
owner: dbarbuzzi
name: tvd
draft: true
archive:
replacements:
darwin: macOS
linux: Linux
windows: Windows
386: 32bit
amd64: 64bit
format_overrides:
- goos: windows
format: zip
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
build:
binary: tvd
ldflags: "-s -w -X main.Version={{ .Version }} -X main.ClientID=${TVD_CLIENT_ID}"
goos:
- darwin
- linux
- windows
goarch:
- amd64
- 386
env:
- CGO_ENABLED=0
brew:
name: tvd
github:
owner: dbarbuzzi
name: hombrew-tap
commit_author:
name: dbarbuzzi
email: [email protected]
folder: Formula
homepage: "https://github.com/dbarbuzzi/tvd"
description: "Download Twitch VODs"
test: |
system "#{bin}/tvd --version"
install: |
bin.install "tvd"
scoop:
bucket:
owner: dbarbuzzi
name: scoop-bucket
commit_author:
name: dbarbuzzi
email: [email protected]
homepage: "https://github.com/dbarbuzzi/tvd"
description: "Download Twitch VODs"
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@ tvd (**T**witch **V**OD **D**ownloader) is a command-line tool to download VODs

## Download

Visit the [releases](https://github.com/dbarbuzzi/tvd/releases/latest) page to download the latest binary for your platform.
### macOS + Homebrew

If you’re using [Homebrew](https://brew.sh) on macOS, you can use it to install `tvd`:

```bash
brew tap github.com/dbarbuzzi/homebrew-tap
brew install tvd
```

### Windows + Scoop

If you’re using [Scoop](https://scoop.sh) on Windows, you can use it to install `tvd`:

```powershell
scoop bucket add dbarbuzzi https://github.com/dbarbuzzi/scoop-bucket.git
scoop install tvd
```

### Others

Visit the [releases](https://github.com/dbarbuzzi/tvd/releases/latest) page to download the latest release for your platform.

## Usage

Expand Down
30 changes: 0 additions & 30 deletions build.sh

This file was deleted.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ module github.com/dbarbuzzi/tvd
require (
github.com/BurntSushi/toml v0.3.0
github.com/mattn/go-runewidth v0.0.2
golang.org/x/sys v0.0.0-20180715085529-ac767d655b30 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.25
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
github.com/BurntSushi/toml v0.3.0 h1:e1/Ivsx3Z0FVTV0NSOv/aVgbUWyQuzj7DDnFblkRvsY=
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
golang.org/x/sys v0.0.0-20180715085529-ac767d655b30 h1:4bYUqrXBoiI7UFQeibUwFhvcHfaEeL75O3lOcZa964o=
golang.org/x/sys v0.0.0-20180715085529-ac767d655b30/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
gopkg.in/cheggaaa/pb.v1 v1.0.25 h1:Ev7yu1/f6+d+b3pi5vPdRPc6nNtP1umSfcWiEfRqv6I=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
22 changes: 22 additions & 0 deletions magefile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// +build mage

package main

import (
"os/exec"
)

func Build() error {
cmd := exec.Command("goreleaser", "release", "--rm-dist", "--skip-publish")
return cmd.Run()
}

func Release() error {
cmd := exec.Command("goreleaser", "release", "--rm-dist")
return cmd.Run()
}

func Snapshot() error {
cmd := exec.Command("goreleaser", "release", "--rm-dist", "--snapshot")
return cmd.Run()
}

0 comments on commit 83f93fa

Please sign in to comment.