Skip to content

Commit

Permalink
Merge pull request #25 from woblerr/bump_infr
Browse files Browse the repository at this point in the history
  • Loading branch information
woblerr authored Dec 28, 2024
2 parents 1c8b837 + 8793ad4 commit 9e5ac23
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 33 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up go 1.21
uses: actions/setup-go@v3
- name: Set up go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23"
id: go

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build and test
run: |
Expand All @@ -26,30 +26,32 @@ jobs:
GOFLAGS: "-mod=vendor"

- name: Run linters
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.62.2
env:
TZ: "Etc/UTC"

- name: Install goveralls
run: |
GO111MODULE=off go get -u github.com/mattn/goveralls
go install github.com/mattn/goveralls@latest
- name: Submit coverage
run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/coverage.out
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
run: echo ${BUILDX_PLATFORMS}
env:
BUILDX_PLATFORMS: ${{ steps.buildx.outputs.platforms }}

- name: Build and push master image to ghcr.io and Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down Expand Up @@ -98,24 +100,24 @@ jobs:
needs: build
runs-on: ubuntu-latest
env:
goreleaser_version: "v1.24.0"
goreleaser_version: "v2.5.0"
steps:
- name: Set up go 1.21
uses: actions/setup-go@v3
- name: Set up go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23"
id: go

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get ref
id: vars
run: |
echo ::set-output name=ref::$(echo ${GITHUB_REF} | cut -d'/' -f3)
- name: Check GoReleaser config
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.goreleaser_version }}
Expand Down
16 changes: 7 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ run:
timeout: 5m
output:
format: colored-line-number
skip-dirs:
- vendor

linters-settings:
govet:
check-shadowing: true
enable:
- shadow
revive:
confidence: 0.1
maligned:
suggest-new: true
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -27,12 +24,11 @@ linters-settings:

linters:
enable:
- megacheck
- staticcheck
- revive
- govet
- unconvert
- megacheck
- gas
- gosec
- gocyclo
- dupl
- misspell
Expand All @@ -42,7 +38,7 @@ linters:
- ineffassign
- stylecheck
- gochecknoinits
- exportloopref
- copyloopvar
- gocritic
- nakedret
- gosimple
Expand All @@ -51,6 +47,8 @@ linters:
disable-all: true

issues:
exclude-dirs:
- vendor
exclude-rules:
- path: _test\.go
linters:
Expand Down
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
version: 2

project_name: authlog_exporter

builds:
Expand Down Expand Up @@ -50,4 +52,4 @@ release:
draft: true

changelog:
skip: true
disable: true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG REPO_BUILD_TAG="unknown"

FROM golang:1.21-alpine3.19 AS builder
FROM golang:1.23-alpine3.20 AS builder
ARG REPO_BUILD_TAG
WORKDIR /go/src/github.com/woblerr/authlog_exporter
COPY . .
Expand All @@ -11,7 +11,7 @@ RUN apk update \
-ldflags "-X main.version=${REPO_BUILD_TAG}" \
-o authlog_exporter authlog_exporter.go

FROM alpine:3.19
FROM alpine:3.20
ARG REPO_BUILD_TAG
RUN apk add --no-cache --update ca-certificates \
&& rm -rf /var/cache/apk/*
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.artifacts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM goreleaser/goreleaser:v1.24.0 as builder
FROM goreleaser/goreleaser:v2.5.0 as builder
WORKDIR /build
COPY . /build
RUN goreleaser release --snapshot --skip-publish --rm-dist
RUN goreleaser release --snapshot --skip=publish --clean

FROM alpine
FROM alpine:3.20
COPY --from=builder /build/dist/ /dist/
RUN mkdir -p /artifacts && \
cp /dist/*.tar.gz /artifacts/ && \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/woblerr/authlog_exporter

go 1.21
go 1.23

require (
github.com/alecthomas/kingpin/v2 v2.4.0
Expand Down
2 changes: 1 addition & 1 deletion test_data/Dockerfile.testdb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /build
COPY --chmod=755 ${SCRIPT_PATH} /build
RUN /build/create_test_database.pl

FROM alpine
FROM alpine:3.20
COPY --from=builder /build/geolite2_test.mmdb /db/
RUN ls -la /db/*
CMD ["sleep", "150"]

0 comments on commit 9e5ac23

Please sign in to comment.