Skip to content

Commit

Permalink
Enable to release by CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaos committed Dec 29, 2024
1 parent 585f687 commit edd2ed4
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 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.20.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
before:
hooks:
- go get golang.org/x/tools/cmd/goyacc
- go yacc -o filter_parser.go filter_parser.y
- rm y.output
- go mod download
builds:
- binary: todoist
goos:
- darwin
- linux
- windows
goarch:
- 386
- amd64
- arm
- arm64
ldflags:
- -s -w -X main.version={{.Version}}
archives:
- id: replace
name_template: >-
{{- .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end -}}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
brews:
- tap:
owner: sachaos
name: homebrew-todoist
folder: Formula
homepage: https://github.com/sachaos/todoist
description: Todoist CLI client
skip_upload: auto
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (

"github.com/fatih/color"
"github.com/rkoesters/xdg/basedir"
"github.com/sachaos/todoist/lib"
todoist "github.com/sachaos/todoist/lib"
"github.com/spf13/viper"
"github.com/urfave/cli/v2"
)

var (
version string
homePath, _ = os.UserHomeDir()
configPath = filepath.Join(basedir.ConfigHome, "todoist")
cachePath = filepath.Join(basedir.CacheHome, "todoist", "cache.json")
Expand All @@ -42,7 +43,7 @@ func main() {
app := cli.NewApp()
app.Name = "todoist"
app.Usage = "Todoist CLI Client"
app.Version = "0.20.0"
app.Version = version
app.EnableBashCompletion = true

contentFlag := cli.StringFlag{
Expand Down

0 comments on commit edd2ed4

Please sign in to comment.