2022-04-29 20:57:00 +02:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: Release version
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-02-09 18:19:58 +02:00
|
|
|
GO_VERSION: '1.20'
|
2022-04-29 20:57:00 +02:00
|
|
|
CGO_ENABLED: 0
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go ${{ env.GO_VERSION }}
|
2022-12-10 12:17:05 +02:00
|
|
|
uses: actions/setup-go@v3
|
2022-04-29 20:57:00 +02:00
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
|
|
|
|
- name: Check out code
|
2022-12-10 12:17:05 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-04-29 20:57:00 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Cache Go modules
|
2022-11-02 18:00:38 +02:00
|
|
|
uses: actions/cache@v3
|
2022-04-29 20:57:00 +02:00
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
2023-02-26 15:27:16 +02:00
|
|
|
- name: Docker Login
|
|
|
|
env:
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
2022-04-29 20:57:00 +02:00
|
|
|
# https://goreleaser.com/ci/actions/
|
|
|
|
- name: Run GoReleaser
|
2022-12-10 12:17:05 +02:00
|
|
|
uses: goreleaser/goreleaser-action@v3
|
2022-04-29 20:57:00 +02:00
|
|
|
with:
|
|
|
|
version: latest
|
2023-02-26 15:27:16 +02:00
|
|
|
args: release --clean --timeout=90m
|
2022-04-29 20:57:00 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}
|