Skip to content

Commit

Permalink
Add release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaos committed Jun 30, 2021
1 parent 542e5c2 commit 5fa17a6
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
42 changes: 42 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
binary: toggl
goos:
- darwin
- linux
- windows
goarch:
- amd64
ldflags:
- -s -w -X github.com/sachaos/toggl.version={{.Version}}
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
brews:
- tap:
owner: sachaos
name: homebrew-tap
folder: Formula
homepage: https://github.com/sachaos/toggl
description: Toggl CLI client
skip_upload: auto
test: |
system "#{bin}/toggl", "--version"
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const (
ConfigType = "json"
)


const Name string = "toggl"

var version string

func main() {
cache.New(os.Getenv("HOME") + "/.toggl.cache.json")
cache.Init()
Expand All @@ -34,7 +39,7 @@ func main() {

app := cli.NewApp()
app.Name = Name
app.Version = Version
app.Version = version
app.Author = "sachaos"
app.Email = "sakataku7@gmail.com"
app.Usage = "Toggl API CLI Client"
Expand Down
4 changes: 0 additions & 4 deletions version.go

This file was deleted.

0 comments on commit 5fa17a6

Please sign in to comment.