Skip to content

Commit

Permalink
Upgrade CI stack and vendors
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatto committed Feb 23, 2021
1 parent 9e88196 commit c97ac30
Show file tree
Hide file tree
Showing 42 changed files with 163 additions and 5,744 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: build_and_test
on: [push]
jobs:
runner:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- run: go build .
- run: go test -v ./...
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release
on:
push:
tags:
- '*'
jobs:
runner:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
Godeps/_workspace
td
build
dist
.todos
27 changes: 27 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
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:'
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ USAGE:
td [global options] command [command options] [arguments...]
VERSION:
1.4.0
1.4.1
AUTHOR:
Gaël Gillard - <gael@gaelgillard.com>
Expand All @@ -53,7 +53,7 @@ GLOBAL OPTIONS:

The MIT License (MIT)

Copyright (c) 2015 Gaël Gillard
Copyright (c) 2021 Gaël Gillard

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 20 additions & 20 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import (
"os"
"strconv"

"github.com/codegangsta/cli"
"github.com/daviddengcn/go-colortext"
ct "github.com/daviddengcn/go-colortext"
"github.com/urfave/cli"
)

func main() {
app := cli.NewApp()
app.Name = "td"
app.Usage = "Your todos manager"
app.Version = "1.4.0"
app.Version = "1.4.1"
app.Author = "Gaël Gillard"
app.Email = "gael@gaelgillard.com"
app.Email = "gillardgael@gmail.com"
app.Flags = []cli.Flag{
cli.BoolFlag{
Name: "done, d",
Expand All @@ -28,7 +28,7 @@ func main() {
}
app.Action = func(c *cli.Context) {
var err error
collection := Collection{}
collection := collection{}

err = collection.RetrieveTodos()
if err != nil {
Expand Down Expand Up @@ -68,7 +68,7 @@ func main() {
return
}

err = CreateStoreFileIfNeeded(cwd + "/.todos")
err = createStoreFileIfNeeded(cwd + "/.todos")
ct.ChangeColor(ct.Cyan, false, ct.None, false)
if err != nil {
fmt.Printf("A \".todos\" file already exist in \"%s\".\n", cwd)
Expand Down Expand Up @@ -96,9 +96,9 @@ func main() {
return
}

collection := Collection{}
todo := Todo{
Id: 0,
collection := collection{}
todo := todo{
ID: 0,
Desc: c.Args()[0],
Status: "pending",
Modified: "",
Expand Down Expand Up @@ -135,7 +135,7 @@ func main() {
return
}

collection := Collection{}
collection := collection{}
collection.RetrieveTodos()

id, err := strconv.ParseInt(c.Args()[0], 10, 32)
Expand Down Expand Up @@ -173,7 +173,7 @@ func main() {
return
}

collection := Collection{}
collection := collection{}
collection.RetrieveTodos()

id, err := strconv.ParseInt(c.Args()[0], 10, 32)
Expand All @@ -198,27 +198,27 @@ func main() {
ShortName: "c",
Usage: "Remove finished todos from the list",
Action: func(c *cli.Context) {
collection := Collection{}
collection := collection{}
collection.RetrieveTodos()

err := collection.RemoveFinishedTodos()

if err != nil {
fmt.Println(err)
return
} else {
ct.ChangeColor(ct.Cyan, false, ct.None, false)
fmt.Println("Your list is now flushed of finished todos.")
ct.ResetColor()
}

ct.ChangeColor(ct.Cyan, false, ct.None, false)
fmt.Println("Your list is now flushed of finished todos.")
ct.ResetColor()
},
},
{
Name: "reorder",
ShortName: "r",
Usage: "Reset ids of todo (no arguments) or swap the position of two todos",
Action: func(c *cli.Context) {
collection := Collection{}
collection := collection{}
collection.RetrieveTodos()

if len(c.Args()) == 1 {
Expand Down Expand Up @@ -290,7 +290,7 @@ func main() {
return
}

collection := Collection{}
collection := collection{}
collection.RetrieveTodos()
collection.Search(c.Args()[0])

Expand Down Expand Up @@ -318,7 +318,7 @@ func main() {

app.Before = func(c *cli.Context) error {
var err error
path := GetDBPath()
path := getDBPath()

if path == "" {
fmt.Println()
Expand All @@ -333,7 +333,7 @@ func main() {
fmt.Println()
}

CreateStoreFileIfNeeded(path)
createStoreFileIfNeeded(path)

return err
}
Expand Down
Loading

0 comments on commit c97ac30

Please sign in to comment.