Skip to content

Commit 26c298f

Browse files
committed
upgrade GO and Github Actions
1 parent 4e0f364 commit 26c298f

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

.github/workflows/docker-publish.yml renamed to .github/workflows/release.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Image
1+
name: Release
22

33
on:
44
release:
@@ -16,30 +16,30 @@ jobs:
1616
packages: write
1717

1818
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2120

22-
- name: Log into registry ${{ env.REGISTRY }}
23-
uses: docker/login-action@v1
21+
- uses: docker/setup-qemu-action@v3
22+
- uses: docker/setup-buildx-action@v3
23+
24+
- uses: docker/login-action@v3
2425
with:
2526
registry: ${{ env.REGISTRY }}
2627
username: ${{ github.actor }}
2728
password: ${{ secrets.GITHUB_TOKEN }}
2829

29-
- name: Extract Docker metadata
30+
- uses: docker/metadata-action@v5
3031
id: meta
31-
uses: docker/metadata-action@v3
3232
with:
3333
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3434
tags: |
3535
type=ref,event=branch
3636
type=ref,event=pr
3737
type=semver,pattern={{version}}
3838
39-
- name: Build and push Docker image
40-
uses: docker/build-push-action@v2
39+
- uses: docker/build-push-action@v5
4140
with:
4241
context: .
42+
platforms: linux/amd64,linux/arm64
4343
push: true
4444
tags: ${{ steps.meta.outputs.tags }}
4545
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM golang:1.16-buster AS builder
2-
WORKDIR /tmp/logparser
1+
FROM golang:1.21-bullseye AS builder
2+
WORKDIR /tmp/src
33
COPY . .
4+
RUN go test ./...
45
RUN go build -mod=readonly -o ./logparser ./cmd/
56

67
FROM scratch
7-
COPY --from=builder /tmp/logparser/logparser /usr/bin/logparser
8+
COPY --from=builder /tmp/src/logparser /usr/bin/logparser
89
ENTRYPOINT ["logparser"]

go.mod

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
module github.com/coroot/logparser
22

3-
go 1.16
3+
go 1.21
44

5-
require github.com/stretchr/testify v1.7.0
5+
require github.com/stretchr/testify v1.8.4
6+
7+
require (
8+
github.com/davecgh/go-spew v1.1.1 // indirect
9+
github.com/pmezard/go-difflib v1.0.0 // indirect
10+
gopkg.in/yaml.v3 v3.0.1 // indirect
11+
)

go.sum

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
33
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
44
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
6-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
7-
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
5+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
6+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
87
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
98
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
10-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
11-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
9+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
10+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)