diff --git a/.github/workflows/go-build-test.yml b/.github/workflows/go-build-test.yml new file mode 100644 index 0000000..b40ce91 --- /dev/null +++ b/.github/workflows/go-build-test.yml @@ -0,0 +1,29 @@ +name: Go + +on: + push: + branches: + - main + - next + pull_request: + branches: + - next + - main + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/golangcilint.yml b/.github/workflows/golangcilint.yml new file mode 100644 index 0000000..c9dd6f7 --- /dev/null +++ b/.github/workflows/golangcilint.yml @@ -0,0 +1,35 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - main + pull_request: + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: v1.39.0 + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + only-new-issues: true + + # Optional: if set to true then the action will use pre-installed Go. + # skip-go-installation: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..203b157 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - v* + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2953aed --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea/ +*.pprof +*.json +profile* +routes/ +*.txt +benchmark/ +dist/ +*.kite \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..e849f7c --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,3 @@ +run: + skip-dirs: + - _templates diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..773ecf2 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,18 @@ +project_name: kiterunner +env: + - GO111MODULE=on +builds: + - binary: kr + id: 'default' + main: ./cmd/kiterunner/main.go + env: + - CGO_ENABLED=0 + ldflags: + - -s -w -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version={{.Version}} -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Commit={{.ShortCommit}} -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Date={{.Date}} + +archives: + - id: default + builds: + - default + files: + - none*