Skip to content

Commit 6b2b7ef

Browse files
author
Joris Berthelot
committed
chore: update dependencies and bump Go version to 1.20
1 parent e8e6eca commit 6b2b7ef

File tree

15 files changed

+705
-61
lines changed

15 files changed

+705
-61
lines changed

.github/workflows/main.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ jobs:
99
name: Unit tests + coverage
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- name: Set up Go 1.x
14-
uses: actions/setup-go@v2
14+
uses: actions/setup-go@v4
1515
with:
16-
go-version: ^1.16
16+
go-version: ^1.20
1717
- name: Get dependencies
1818
run: go get -v -t -d ./...
1919
- name: Build
2020
run: go build -v ./...
2121
- name: Test with coverage
2222
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
2323
- name: Upload coverage report
24-
uses: codecov/codecov-action@v1
24+
uses: codecov/codecov-action@v3
2525
with:
2626
token: ${{ secrets.CODECOV_TOKEN }}
2727
file: ./coverage.txt
@@ -32,37 +32,37 @@ jobs:
3232
name: Go linting
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
3636
- name: Lint the codebase
37-
uses: golangci/golangci-lint-action@v2
37+
uses: golangci/golangci-lint-action@v3
3838
with:
39-
version: v1.34
39+
version: latest
4040
publish:
4141
name: Docker publish
4242
if: contains(github.ref, 'refs/tags/')
4343
needs: [ tests, lint ]
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v2
47-
- uses: docker/setup-qemu-action@v1
48-
- uses: docker/setup-buildx-action@v1
46+
- uses: actions/checkout@v3
47+
- uses: docker/setup-qemu-action@v2
48+
- uses: docker/setup-buildx-action@v2
4949
- name: Login to DockerHub
50-
uses: docker/login-action@v1
50+
uses: docker/login-action@v2
5151
with:
5252
username: ${{ secrets.DOCKERHUB_USERNAME }}
5353
password: ${{ secrets.DOCKERHUB_TOKEN }}
5454
- name: Retrieve tag
5555
id: tagref
5656
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
5757
- name: Build and push
58-
uses: docker/build-push-action@v2
58+
uses: docker/build-push-action@v4
5959
with:
6060
platforms: linux/amd64
6161
build-args: version=${{ steps.tagref.outputs.tag }}+${{ github.sha }}
6262
tags: '${{ github.repository }}:${{ steps.tagref.outputs.tag }},${{ github.repository }}:latest'
6363
push: true
6464
- name: Update repo description
65-
uses: peter-evans/dockerhub-description@v2
65+
uses: peter-evans/dockerhub-description@v3
6666
with:
6767
username: ${{ secrets.DOCKERHUB_USERNAME }}
6868
password: ${{ secrets.DOCKERHUB_PASSWORD }}
@@ -78,16 +78,16 @@ jobs:
7878
matrix:
7979
target: [http2smtp, http2smtp-lambda]
8080
steps:
81-
- uses: actions/checkout@v2
81+
- uses: actions/checkout@v3
8282
- name: Retrieve tag
8383
id: tagref
8484
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
85-
- uses: wangyoucao577/go-release-action@v1.18
85+
- uses: wangyoucao577/go-release-action@v1
8686
with:
8787
github_token: ${{ secrets.GH_TOKEN }}
8888
goos: linux
8989
goarch: amd64
90-
goversion: '1.16'
90+
goversion: '1.20'
9191
project_path: cmd/${{ matrix.target }}
9292
binary_name: ${{ matrix.target }}
9393
extra_files: LICENSE README.md

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM eexit/curl-healthchecker:v1.0.0 AS curl
22

3-
FROM golang:1.16 AS builder
3+
FROM golang:1.20 AS builder
44
RUN apt-get update -y \
55
&& apt-get install -y upx \
66
&& update-ca-certificates

cmd/http2smtp-lambda/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
func main() {
19-
rand.Seed(time.Now().UTC().UnixNano())
19+
rand.New(rand.NewSource(time.Now().UnixNano()))
2020

2121
var e env.Bag
2222
envconfig.MustProcess("", &e)
@@ -43,5 +43,5 @@ func main() {
4343
app := api.New(e, logger, smtpClient, converterProvider)
4444
adapter := httpadapter.New(app.Wrap(app.Mux()))
4545

46-
lambda.StartHandler(lambda.NewHandler(adapter.ProxyWithContext))
46+
lambda.Start(lambda.NewHandler(adapter.ProxyWithContext))
4747
}

cmd/http2smtp/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func main() {
17-
rand.Seed(time.Now().UTC().UnixNano())
17+
rand.New(rand.NewSource(time.Now().UnixNano()))
1818

1919
var e env.Bag
2020
envconfig.MustProcess("", &e)

go.mod

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
module github.com/eexit/http2smtp
22

3-
go 1.16
3+
go 1.20
44

55
require (
6-
github.com/aws/aws-lambda-go v1.24.0
7-
github.com/awslabs/aws-lambda-go-api-proxy v0.10.0
8-
github.com/go-playground/validator/v10 v10.6.1
6+
github.com/aws/aws-lambda-go v1.39.1
7+
github.com/awslabs/aws-lambda-go-api-proxy v0.14.0
8+
github.com/go-playground/validator/v10 v10.12.0
99
github.com/gorilla/mux v1.8.0
1010
github.com/justinas/alice v1.2.0
1111
github.com/kelseyhightower/envconfig v1.4.0
12-
github.com/leodido/go-urn v1.2.1 // indirect
13-
github.com/rs/xid v1.3.0 // indirect
14-
github.com/rs/zerolog v1.22.0
15-
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
16-
golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b // indirect
17-
golang.org/x/text v0.3.6 // indirect
12+
github.com/rs/zerolog v1.29.0
13+
)
14+
15+
require (
16+
github.com/go-playground/locales v0.14.1 // indirect
17+
github.com/go-playground/universal-translator v0.18.1 // indirect
18+
github.com/leodido/go-urn v1.2.3 // indirect
19+
github.com/mattn/go-colorable v0.1.13 // indirect
20+
github.com/mattn/go-isatty v0.0.18 // indirect
21+
github.com/rs/xid v1.4.0 // indirect
22+
golang.org/x/crypto v0.8.0 // indirect
23+
golang.org/x/sys v0.7.0 // indirect
24+
golang.org/x/text v0.9.0 // indirect
1825
)

0 commit comments

Comments
 (0)