Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e86e08
commit f56f549
Showing
20 changed files
with
1,178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
# the configuration file of cmdx - task runner | ||
# https://github.com/suzuki-shunsuke/cmdx | ||
tasks: | ||
- name: init | ||
short: i | ||
script: bash scripts/githook.sh | ||
description: setup git hooks | ||
usage: setup git hooks | ||
- name: coverage | ||
short: c | ||
description: test a package | ||
usage: test a package | ||
script: "bash scripts/coverage.sh {{.path}}" | ||
args: | ||
- name: path | ||
- name: test | ||
short: t | ||
description: test | ||
usage: test | ||
script: go test -v ./... -race -covermode=atomic | ||
- name: fmt | ||
description: format the go code | ||
usage: format the go code | ||
script: bash scripts/fmt.sh | ||
require: | ||
exec: | ||
- gofumpt | ||
- name: vet | ||
short: v | ||
description: go vet | ||
usage: go vet | ||
script: go vet ./... | ||
- name: lint | ||
short: l | ||
description: lint the go code | ||
usage: lint the go code | ||
script: golangci-lint run | ||
- name: release | ||
short: r | ||
description: release the new version | ||
usage: release the new version | ||
script: "bash scripts/release.sh {{.version}}" | ||
args: | ||
- name: version | ||
required: true | ||
validate: | ||
- regexp: "^v\\d+\\.\\d+.\\d+(-\\d+)?$" | ||
- name: install | ||
description: go install | ||
usage: go install | ||
script: go install ./cmd/aqua | ||
- name: build | ||
description: go build | ||
usage: go build | ||
script: go build -o dist/aqua ./cmd/aqua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
name: test | ||
on: | ||
push: | ||
branches: [master] | ||
tags: [v*] | ||
pull_request: | ||
branches: [master] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.15.0' | ||
- run: go version | ||
- run: go mod download | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.33 | ||
|
||
- name: remove changes | ||
# Sometimes it is failed to release by goreleaser due to changes of go.sum | ||
run: git checkout -- . | ||
- name: fetch tags to release | ||
run: git fetch --tags | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run GoReleaser (skip publish) | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: "! startsWith(github.ref, 'refs/tags/')" | ||
with: | ||
version: latest | ||
args: release --rm-dist --snapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
linters: | ||
enable-all: true | ||
disable: | ||
- maligned # WARN [runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'. | ||
- interfacer # WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. | ||
- scopelint # WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref. | ||
- wsl | ||
- goerr113 | ||
- lll | ||
- godot | ||
- nlreturn | ||
- godox | ||
- golint | ||
- tagliatelle | ||
- exhaustivestruct # https://github.com/mbilski/exhaustivestruct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
project_name: aqua | ||
archives: | ||
- name_template: "{{.ProjectName}}_{{.Os}}_{{.Arch}}" | ||
builds: | ||
- binary: aqua | ||
main: cmd/aqua/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- windows | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
release: | ||
prerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"os" | ||
"os/signal" | ||
|
||
"github.com/sirupsen/logrus" | ||
"github.com/suzuki-shunsuke/aqua/pkg/cli" | ||
) | ||
|
||
func main() { | ||
if err := core(); err != nil { | ||
logrus.Fatal(err) | ||
} | ||
} | ||
|
||
func core() error { | ||
runner := cli.Runner{ | ||
Stdin: os.Stdin, | ||
Stdout: os.Stdout, | ||
Stderr: os.Stderr, | ||
} | ||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) | ||
defer stop() | ||
return runner.Run(ctx, os.Args...) //nolint:wrapcheck | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
packages: | ||
- name: akoi | ||
repository: inline | ||
version: v2.2.1 | ||
inline_repository: | ||
- name: akoi | ||
type: github_release | ||
repo: suzuki-shunsuke/akoi | ||
artifact: 'akoi_{{trimPrefix "v" .Package.Version}}_{{.OS}}_{{.Arch}}.tar.gz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module github.com/suzuki-shunsuke/aqua | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/Masterminds/sprig/v3 v3.2.2 | ||
github.com/google/go-github/v38 v38.1.0 | ||
github.com/mholt/archiver/v3 v3.5.0 | ||
github.com/sirupsen/logrus v1.8.1 | ||
github.com/suzuki-shunsuke/go-findconfig v1.0.0 | ||
github.com/suzuki-shunsuke/go-template-unmarshaler v0.1.0 | ||
github.com/suzuki-shunsuke/go-timeout v1.0.0 | ||
github.com/urfave/cli/v2 v2.3.0 | ||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f | ||
gopkg.in/yaml.v2 v2.4.0 | ||
) |
Oops, something went wrong.