Skip to content

Bump golang.org/x/mod from 0.17.0 to 0.18.0 (#180) #593

Bump golang.org/x/mod from 0.17.0 to 0.18.0 (#180)

Bump golang.org/x/mod from 0.17.0 to 0.18.0 (#180) #593

Workflow file for this run

name: Go
on:
push:
branches: [main]
pull_request:
branches: [main]
create:
tags:
- v*
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Build
run: |
go build -v .
go clean
- name: Test
run: go test -v ./... -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/[email protected]
with:
infile: coverage.out
outfile: coverage.lcov
- name: Upload coverages
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
- name: Trigger Go Report Card
run: curl -d "repo=github.com/fhopfensperger/git-releaser" https://goreportcard.com/checks
- name: Clean directory
run: rm coverage.lcov
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Set release version
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "RELEASE_VERSION_WITHOUT_V=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Set up QEMU
if: startsWith(github.ref, 'refs/tags/')
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: startsWith(github.ref, 'refs/tags/')
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BUILD_VERSION=${{ env.RELEASE_VERSION_WITHOUT_V }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION_WITHOUT_V }}