Skip to content

bump go version in go.mod #51

bump go version in go.mod

bump go version in go.mod #51

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
# setup
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ">=1.20.0"
check-latest: true
- uses: nolar/setup-k3d-k3s@v1
with:
skip-creation: true
skip-readiness: true
- name: Get Version
id: get_version
run: echo "VERSION=${GITHUB_REF##*/}" >> "${GITHUB_OUTPUT}"
# run all tests
- name: Tests
run: ./test/run all
# release
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config=.goreleaser.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
# build and push docker image
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Build and push
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
IMAGE=docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPOSITORY }}
echo version=$VERSION
cat docker/Dockerfile
docker build . -t $IMAGE:$VERSION -t $IMAGE:latest -f docker/Dockerfile --build-arg VERSION=$VERSION
docker push $IMAGE:$VERSION
docker push $IMAGE:latest