Skip to content

Commit

Permalink
Merge pull request #45 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 0.5.2
  • Loading branch information
andyone authored Apr 2, 2022
2 parents 190f528 + 4e36f0f commit ef46778
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 54 deletions.
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
34 changes: 7 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}

Expand Down Expand Up @@ -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
Expand All @@ -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}}

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
yo
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

################################################################################

Expand All @@ -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 {} \;
Expand All @@ -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'

################################################################################
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions common/yo.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}

Expand All @@ -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}
Expand Down Expand Up @@ -124,6 +126,11 @@ fi
################################################################################

%changelog
* Tue Mar 29 2022 Anton Novojilov <[email protected]> - 0.5.2-0
- Removed pkg.re usage
- Added module info
- Added Dependabot configuration

* Fri Dec 04 2020 Anton Novojilov <[email protected]> - 0.5.1-0
- ek package updated to the latest stable version
- Added completion generation
Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
)
14 changes: 14 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
28 changes: 14 additions & 14 deletions yo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2020 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -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"
)

Expand Down

0 comments on commit ef46778

Please sign in to comment.