Skip to content

Commit 2ca742c

Browse files
authored
Merge pull request #21 from webdevops/copilot/update-go-version-1-26-5
chore: upgrade Go to 1.26.5 and update GitHub Actions to latest versions
2 parents bfd06f8 + eff8175 commit 2ca742c

12 files changed

Lines changed: 79 additions & 69 deletions

File tree

.github/workflows/ci-docker.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v7
1010

1111
- name: Set Swap Space
1212
uses: pierotofy/set-swap-space@master
1313
with:
1414
swap-size-gb: 12
1515

1616
- name: Run Golangci lint
17-
uses: golangci/golangci-lint-action@v2
17+
uses: golangci/golangci-lint-action@v9
1818
with:
1919
version: latest
20-
args: --print-resources-usage
20+
args: --verbose
2121

2222
- name: Docker meta
2323
id: docker_meta
24-
uses: docker/metadata-action@v3
24+
uses: docker/metadata-action@v6
2525
with:
2626
images: ${{ github.repository }},quay.io/${{ github.repository }}
2727
labels: |
2828
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
2929
3030
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v1
31+
uses: docker/setup-qemu-action@v4
3232

3333
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v1
34+
uses: docker/setup-buildx-action@v4
3535

3636
- name: Build
37-
uses: docker/build-push-action@v2
37+
uses: docker/build-push-action@v7
3838
with:
3939
context: .
4040
file: ./Dockerfile

.github/workflows/release-assets.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ jobs:
88
release:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v7
1212

1313
- name: Set Swap Space
1414
uses: pierotofy/set-swap-space@master
1515
with:
1616
swap-size-gb: 12
1717

18-
- uses: actions/setup-go@v2
18+
- uses: actions/setup-go@v6
1919
with:
20-
go-version: '1.19'
20+
go-version: '1.26.5'
2121
check-latest: true
2222

2323
- name: Build
2424
run: |
2525
make release-assets
2626
2727
- name: Upload assets to release
28-
uses: svenstaro/upload-release-action@v2
28+
uses: svenstaro/upload-release-action@2.11.5
2929
with:
3030
repo_token: ${{ secrets.GITHUB_TOKEN }}
3131
file: ./release-assets/*

.github/workflows/release-docker.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
lint:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v7
1515

1616
- name: Set Swap Space
1717
uses: pierotofy/set-swap-space@master
1818
with:
1919
swap-size-gb: 12
2020

2121
- name: Run Golangci lint
22-
uses: golangci/golangci-lint-action@v2
22+
uses: golangci/golangci-lint-action@v9
2323
with:
2424
version: latest
25-
args: --print-resources-usage
25+
args: --verbose
2626

2727
build:
2828
needs: lint
@@ -35,7 +35,7 @@ jobs:
3535
include: []
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v7
3939

4040
- name: Set Swap Space
4141
uses: pierotofy/set-swap-space@master
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Docker meta
4646
id: docker_meta
47-
uses: docker/metadata-action@v4
47+
uses: docker/metadata-action@v6
4848
with:
4949
images: ${{ github.repository }},quay.io/${{ github.repository }}
5050
labels: |
@@ -54,26 +54,26 @@ jobs:
5454
suffix=${{ matrix.suffix }}
5555
5656
- name: Set up QEMU
57-
uses: docker/setup-qemu-action@v1
57+
uses: docker/setup-qemu-action@v4
5858

5959
- name: Set up Docker Buildx
60-
uses: docker/setup-buildx-action@v1
60+
uses: docker/setup-buildx-action@v4
6161

6262
- name: Login to DockerHub
63-
uses: docker/login-action@v1
63+
uses: docker/login-action@v4
6464
with:
6565
username: ${{ secrets.DOCKERHUB_USERNAME }}
6666
password: ${{ secrets.DOCKERHUB_TOKEN }}
6767

6868
- name: Login to Quay
69-
uses: docker/login-action@v1
69+
uses: docker/login-action@v4
7070
with:
7171
registry: quay.io
7272
username: ${{ secrets.QUAY_USERNAME }}
7373
password: ${{ secrets.QUAY_TOKEN }}
7474

7575
- name: Build and push
76-
uses: docker/build-push-action@v2
76+
uses: docker/build-push-action@v7
7777
with:
7878
context: .
7979
file: ./${{ matrix.Dockerfile }}

.github/workflows/scheduled-docker.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ jobs:
88
lint:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v7
1212

1313
- name: Set Swap Space
1414
uses: pierotofy/set-swap-space@master
1515
with:
1616
swap-size-gb: 12
1717

1818
- name: Run Golangci lint
19-
uses: golangci/golangci-lint-action@v2
19+
uses: golangci/golangci-lint-action@v9
2020
with:
2121
version: latest
22-
args: --print-resources-usage
22+
args: --verbose
2323

2424
build:
2525
needs: lint
@@ -32,7 +32,7 @@ jobs:
3232
include: []
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v7
3636

3737
- name: Set Swap Space
3838
uses: pierotofy/set-swap-space@master
@@ -41,7 +41,7 @@ jobs:
4141

4242
- name: Docker meta
4343
id: docker_meta
44-
uses: docker/metadata-action@v4
44+
uses: docker/metadata-action@v6
4545
with:
4646
images: ${{ github.repository }},quay.io/${{ github.repository }}
4747
labels: |
@@ -51,26 +51,26 @@ jobs:
5151
suffix=${{ matrix.suffix }}
5252
5353
- name: Set up QEMU
54-
uses: docker/setup-qemu-action@v1
54+
uses: docker/setup-qemu-action@v4
5555

5656
- name: Set up Docker Buildx
57-
uses: docker/setup-buildx-action@v1
57+
uses: docker/setup-buildx-action@v4
5858

5959
- name: Login to DockerHub
60-
uses: docker/login-action@v1
60+
uses: docker/login-action@v4
6161
with:
6262
username: ${{ secrets.DOCKERHUB_USERNAME }}
6363
password: ${{ secrets.DOCKERHUB_TOKEN }}
6464

6565
- name: Login to Quay
66-
uses: docker/login-action@v1
66+
uses: docker/login-action@v4
6767
with:
6868
registry: quay.io
6969
username: ${{ secrets.QUAY_USERNAME }}
7070
password: ${{ secrets.QUAY_TOKEN }}
7171

7272
- name: Build and push
73-
uses: docker/build-push-action@v2
73+
uses: docker/build-push-action@v7
7474
with:
7575
context: .
7676
file: ./${{ matrix.Dockerfile }}

.golangci.yaml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
1-
run:
2-
timeout: 120m
3-
1+
version: "2"
42
linters:
53
enable:
64
- asciicheck
75
- bidichk
86
- bodyclose
7+
- copyloopvar
98
- errorlint
10-
- exportloopref
9+
- gosec
10+
settings:
11+
gosec:
12+
confidence: low
13+
config:
14+
global:
15+
audit: true
16+
exclusions:
17+
generated: lax
18+
presets:
19+
- comments
20+
- common-false-positives
21+
- legacy
22+
- std-error-handling
23+
paths:
24+
- third_party$
25+
- builtin$
26+
- examples$
27+
formatters:
28+
enable:
1129
- gofmt
1230
- goimports
13-
- gosec
14-
15-
linters-settings:
16-
gosec:
17-
excludes: []
18-
confidence: low
19-
config:
20-
global:
21-
audit: true
22-
23-
issues: {}
24-
25-
output:
26-
sort-results: true
31+
exclusions:
32+
generated: lax
33+
paths:
34+
- third_party$
35+
- builtin$
36+
- examples$

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#############################################
22
# Build
33
#############################################
4-
FROM --platform=$BUILDPLATFORM golang:1.19-alpine as build
4+
FROM --platform=$BUILDPLATFORM golang:1.26.5-alpine AS build
55

66
RUN apk upgrade --no-cache --force
77
RUN apk add --update build-base make git
@@ -21,7 +21,7 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
2121
#############################################
2222
# Test
2323
#############################################
24-
FROM gcr.io/distroless/static as test
24+
FROM gcr.io/distroless/static AS test
2525
USER 0:0
2626
WORKDIR /app
2727
COPY --from=build /go/src/github.com/webdevops/go-replace/go-replace .

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cram-test: build
5959

6060
.PHONY: lint
6161
lint: $(GOLANGCI_LINT_BIN)
62-
time $(GOLANGCI_LINT_BIN) run --verbose --print-resources-usage
62+
time $(GOLANGCI_LINT_BIN) run --verbose --verbose
6363

6464
$(GOLANGCI_LINT_BIN):
6565
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(FIRST_GOPATH)/bin

filehandling.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// buffered reader.
1616
func Readln(r *bufio.Reader) (string, error) {
1717
var (
18-
isPrefix bool = true
18+
isPrefix = true
1919
err error = nil
2020
line, ln []byte
2121
)

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/webdevops/go-replace
22

3-
go 1.19
3+
go 1.26.5
44

55
require (
66
github.com/Masterminds/sprig v2.22.0+incompatible
@@ -17,6 +17,6 @@ require (
1717
github.com/mitchellh/copystructure v1.2.0 // indirect
1818
github.com/mitchellh/reflectwalk v1.0.2 // indirect
1919
github.com/stretchr/testify v1.7.1 // indirect
20-
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b // indirect
21-
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
20+
golang.org/x/crypto v0.54.0 // indirect
21+
golang.org/x/sys v0.47.0 // indirect
2222
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ github.com/remeh/sizedwaitgroup v1.0.0/go.mod h1:3j2R4OIe/SeS6YDhICBy22RWjJC5eNC
2525
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
2626
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
2727
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
28-
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b h1:huxqepDufQpLLIRXiVkTvnxrzJlpwmIWAObmcCcUFr0=
29-
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
28+
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
29+
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
3030
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
31-
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI=
32-
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
31+
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
32+
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
3333
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3434
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3535
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=

0 commit comments

Comments
 (0)