Skip to content

Commit

Permalink
Bump goreleaser, golangci-lint and actions.
Browse files Browse the repository at this point in the history
Bump goreleaser to v2.5.0.
Bump golangci-lint  to v1.62.2, fix linters.
Bump actions/setup-go to v5.
Bump actions/checkout to v4.
Bump golangci/golangci-lint-action to v6.
Bump docker/setup-qemu-action to v3.
Bump docker/setup-buildx-action to v3.
Bump goreleaser/goreleaser-action to v6.
  • Loading branch information
woblerr committed Dec 27, 2024
1 parent a7affcc commit 8793ad4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up go 1.23
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
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.23
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
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.artifacts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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:3.20
COPY --from=builder /build/dist/ /dist/
Expand Down

0 comments on commit 8793ad4

Please sign in to comment.