Skip to content

Commit

Permalink
fixed versions, some logging + release-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ninlil committed Mar 29, 2022
1 parent a578bf0 commit 2cb1c92
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# .github/workflows/release.yaml

on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
# goarch: ["386", amd64, arm64]
goarch: [amd64, arm64]
exclude:
# - goarch: "386"
# goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v2
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
# goversion: "https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz"
# project_path: "./cmd/test-binary"
binary_name: tmpl8
# extra_files: LICENSE README.md

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ m-y:
go run . <test/m-input.yaml test/m-tmpl.yaml -v

m-j:
go run . -s <test/m-input.json test/m-tmpl.yaml -v
go run . -s <test/m-input.json test/m-tmpl.yaml -v

multi:
go run . -i test/m-input.yaml -i test/m-input.json test/m-tmpl.yaml -v -s
2 changes: 1 addition & 1 deletion import.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"

"github.com/rs/zerolog/log"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func importObjects() ([]interface{}, error) {
Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func main() {

var output bytes.Buffer

if args.Verbose {
log.Info().Msgf("generating %d objects using %d templates", len(olist), len(templates))
}

for _, o := range olist {
err = handle(templates, o, &output)
if err != nil {
Expand Down Expand Up @@ -63,7 +67,7 @@ func handle(list []entry, o interface{}, w io.Writer) error {

for _, e := range list {
if args.Verbose {
log.Info().Msgf("applying template '%s'...", e.name)
log.Trace().Msgf("applying template '%s'...", e.name)
}

tmpl, err := template.New("base").Funcs(sprig.TxtFuncMap()).Parse(e.data)
Expand Down

0 comments on commit 2cb1c92

Please sign in to comment.