diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fc51337 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,30 @@ +version: 2 + +updates: + - package-ecosystem: "gomod" + directory: "/" + target-branch: "develop" + schedule: + interval: "daily" + timezone: "Europe/London" + time: "03:00" + labels: + - "PR • MAINTENANCE" + assignees: + - "andyone" + reviewers: + - "andyone" + + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "develop" + schedule: + interval: "daily" + timezone: "Europe/London" + time: "04:00" + labels: + - "PR • MAINTENANCE" + assignees: + - "andyone" + reviewers: + - "andyone" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e65bba7..c02c081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - go: [ '1.16.x', '1.17.x' ] + go: [ '1.17.x', '1.18.x' ] steps: - name: Set up Go @@ -35,7 +35,7 @@ jobs: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{env.SRC_DIR}} @@ -65,7 +65,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: '1.16.x' + go-version: '1.17.x' id: go - name: Setup PATH @@ -75,7 +75,7 @@ jobs: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{env.SRC_DIR}} @@ -97,7 +97,7 @@ jobs: steps: - name: Code checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login to DockerHub uses: docker/login-action@v1 @@ -113,26 +113,6 @@ jobs: with: files: common/yo.spec - Gosec: - name: Gosec - runs-on: ubuntu-latest - - needs: Go - - steps: - - name: Code checkout - uses: actions/checkout@v2 - - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: '-no-fail -fmt sarif -out results.sarif ./...' - - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: results.sarif - Hadolint: name: Hadolint runs-on: ubuntu-latest @@ -141,7 +121,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Check dockerfiles with Hadolint uses: essentialkaos/hadolint-action@v1 @@ -156,7 +136,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login to DockerHub uses: docker/login-action@v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..35b6f5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +yo diff --git a/Makefile b/Makefile index a1bb83f..eb16c29 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,16 @@ ################################################################################ -# This Makefile generated by GoMakeGen 1.3.2 using next command: -# gomakegen . +# This Makefile generated by GoMakeGen 1.5.1 using next command: +# gomakegen --mod . # # More info: https://kaos.sh/gomakegen ################################################################################ +export GO111MODULE=on + .DEFAULT_GOAL := help -.PHONY = fmt vet all clean git-config deps help +.PHONY = fmt vet all clean deps mod-init mod-update mod-vendor help ################################################################################ @@ -23,12 +25,17 @@ install: ## Install all binaries uninstall: ## Uninstall all binaries rm -f /usr/bin/yo -git-config: ## Configure git redirects for stable import path services - git config --global http.https://pkg.re.followRedirects true +deps: mod-update ## Download dependencies + +mod-init: ## Initialize new module + go mod init + go mod tidy + +mod-update: ## Download modules to local cache + go mod download -deps: git-config ## Download dependencies - go get -d -v pkg.re/essentialkaos/ek.v12 - go get -d -v pkg.re/essentialkaos/go-simpleyaml.v2 +mod-vendor: ## Make vendored copy of dependencies + go mod vendor fmt: ## Format source code with gofmt find . -name "*.go" -exec gofmt -s -w {} \; @@ -44,6 +51,6 @@ help: ## Show this info @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}' @echo -e '' - @echo -e '\033[90mGenerated by GoMakeGen 1.3.2\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n' ################################################################################ diff --git a/README.md b/README.md index ac611db..2f45f1a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Yo is a command-line YAML processor. #### From source -To build the Yo from scratch, make sure you have a working Go 1.16+ workspace (_[instructions](https://golang.org/doc/install)_), then: +To build the Yo from scratch, make sure you have a working Go 1.17+ workspace (_[instructions](https://golang.org/doc/install)_), then: ``` go get github.com/essentialkaos/yo diff --git a/common/yo.spec b/common/yo.spec index bf701eb..edbf375 100644 --- a/common/yo.spec +++ b/common/yo.spec @@ -44,7 +44,7 @@ Summary: Command-line YAML processor Name: yo -Version: 0.5.1 +Version: 0.5.2 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -54,7 +54,7 @@ Source0: https://source.kaos.st/%{name}/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: golang >= 1.14 +BuildRequires: golang >= 1.17 Provides: %{name} = %{version}-%{release} @@ -70,7 +70,9 @@ Command-line YAML processor. %build export GOPATH=$(pwd) -go build src/github.com/essentialkaos/%{name}/%{name}.go +pushd src/github.com/essentialkaos/%{name} + go build -mod vendor -o $GOPATH/%{name} %{name}.go +popd %install rm -rf %{buildroot} @@ -124,6 +126,11 @@ fi ################################################################################ %changelog +* Tue Mar 29 2022 Anton Novojilov - 0.5.2-0 +- Removed pkg.re usage +- Added module info +- Added Dependabot configuration + * Fri Dec 04 2020 Anton Novojilov - 0.5.1-0 - ek package updated to the latest stable version - Added completion generation diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..710e81a --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module github.com/essentialkaos/yo + +go 1.17 + +require ( + github.com/essentialkaos/ek/v12 v12.42.1 + github.com/essentialkaos/go-simpleyaml/v2 v2.1.3 +) + +require ( + golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..71925ba --- /dev/null +++ b/go.sum @@ -0,0 +1,14 @@ +github.com/essentialkaos/check v1.2.1 h1:avvyFy/1acUNwfxwuOLsHeCjfXtMygtbu0lVDr3nxFs= +github.com/essentialkaos/ek/v12 v12.42.1 h1:h3PPy0XNXUj1IsEid/p9IzaF0o5hZEGOBFh7XZawAyg= +github.com/essentialkaos/ek/v12 v12.42.1/go.mod h1:Cv/tOZshmFg4pMJnBkg4aW/WyYhzzc41qzZIfk5RSi4= +github.com/essentialkaos/go-simpleyaml/v2 v2.1.3 h1:DAFvXut4ZtkuiTKWqSux3W0myuv3TOAwiD6w5MKWxsM= +github.com/essentialkaos/go-simpleyaml/v2 v2.1.3/go.mod h1:LAUFukPmTZ4fmHa1K3LsH8MO257r/CL/BqlaP/2Vgcs= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/yo.go b/yo.go index debcd28..eae489e 100644 --- a/yo.go +++ b/yo.go @@ -2,7 +2,7 @@ package main // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2022 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -15,25 +15,25 @@ import ( "strconv" "strings" - "pkg.re/essentialkaos/ek.v12/env" - "pkg.re/essentialkaos/ek.v12/fmtc" - "pkg.re/essentialkaos/ek.v12/fsutil" - "pkg.re/essentialkaos/ek.v12/options" - "pkg.re/essentialkaos/ek.v12/usage" - "pkg.re/essentialkaos/ek.v12/usage/completion/bash" - "pkg.re/essentialkaos/ek.v12/usage/completion/fish" - "pkg.re/essentialkaos/ek.v12/usage/completion/zsh" - "pkg.re/essentialkaos/ek.v12/usage/man" - "pkg.re/essentialkaos/ek.v12/usage/update" - - "pkg.re/essentialkaos/go-simpleyaml.v2" + "github.com/essentialkaos/ek/v12/env" + "github.com/essentialkaos/ek/v12/fmtc" + "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v12/options" + "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v12/usage/completion/bash" + "github.com/essentialkaos/ek/v12/usage/completion/fish" + "github.com/essentialkaos/ek/v12/usage/completion/zsh" + "github.com/essentialkaos/ek/v12/usage/man" + "github.com/essentialkaos/ek/v12/usage/update" + + "github.com/essentialkaos/go-simpleyaml/v2" ) // ////////////////////////////////////////////////////////////////////////////////// // const ( APP = "Yo" - VER = "0.5.1" + VER = "0.5.2" DESC = "Command-line YAML processor" )