From ca4aebf6bd0a788b877c78d7dd066774fb7d1e03 Mon Sep 17 00:00:00 2001 From: Jonathan Seth Mainguy Date: Mon, 16 Sep 2024 15:50:36 -0400 Subject: [PATCH] fix: use go version 1.23.1 --- .github/workflows/push.yml | 30 +++++---------------------- .github/workflows/release-please.yaml | 12 +++++++++++ .github/workflows/release.yml | 27 ------------------------ .goreleaser.yml | 21 +++++++++++-------- go.mod | 8 ++++++- go.sum | 19 +---------------- tests/fmtlint.sh | 12 ----------- 7 files changed, 37 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/release-please.yaml delete mode 100644 .github/workflows/release.yml delete mode 100755 tests/fmtlint.sh diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index fe519ec..9bfbe7f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,28 +1,8 @@ +name: Call Reusable Golang CI Workflow + on: - push: + push: -name: push jobs: - test_build: - name: test, build - runs-on: ubuntu-latest - steps: - - name: install go - uses: actions/setup-go@v5.0.1 - with: - go-version: '1.14.9' - - - name: git checkout - uses: actions/checkout@v4.1.6 - - - name: install lint - run: GO111MODULE=off go get golang.org/x/lint/golint - - - name: run golint and go fmt - run: ./tests/fmtlint.sh - - - name: go test - run: go test - - - name: go build - run: go build + golang-ci: + uses: Jmainguy/golang-workflows/.github/workflows/golang-ci.yml@v1 diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..0dc851a --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,12 @@ +name: Call Reusable Golang Release-Please Workflow + +on: + push: + branches: + - main + +jobs: + release-please: + uses: Jmainguy/golang-workflows/.github/workflows/golang-release.yml@v1 + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e3e6e70..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - push: - tags: - - '*' - -name: release -jobs: - release: - name: run gorleaser - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v4.1.6 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.14.9 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.goreleaser.yml b/.goreleaser.yml index 551136b..c345b5b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 env: - GO111MODULE=on before: @@ -14,15 +15,17 @@ builds: goarch: - amd64 archives: -- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - replacements: - darwin: Darwin - linux: Linux - windows: Windows - amd64: x86_64 - format_overrides: - - goos: windows - format: zip + - name_template: >- + {{- .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end -}} + format_overrides: + - goos: windows + format: zip + nfpms: - file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' homepage: https://soh.re diff --git a/go.mod b/go.mod index a820682..2aa9686 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,11 @@ module github.com/jmainguy/kibanaRefreshFields -go 1.13 +go 1.23.1 require github.com/stretchr/testify v1.9.0 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum index e3d1b09..60ce688 100644 --- a/go.sum +++ b/go.sum @@ -1,27 +1,10 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tests/fmtlint.sh b/tests/fmtlint.sh deleted file mode 100755 index fb464ff..0000000 --- a/tests/fmtlint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -FormatCheck=$(gofmt -l *.go | wc -l) -if [ $FormatCheck -gt 0 ]; then - gofmt -l *.go - echo "gofmt -w *.go your code please." - exit 1 -fi -## Run golint -golint -set_exit_status -if [ $? -gt 0 ]; then - exit 1 -fi