-
Notifications
You must be signed in to change notification settings - Fork 100
46 lines (42 loc) · 1.3 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Fetch all tags
run: git fetch --force --tags
- name: Cleanup pre-release tags
run: git tag -l | grep -E "v[0-9]+.[0-9]+.[0-9]+-(alpha|beta|rc).[0-9]+" | xargs git tag -d
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "^1.21.4"
- name: Setup workspace
run: cp go.work.dist go.work
- name: Log in to Docker Hub
if: ${{ !contains(github.ref_name, '-') }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run GoReleaser for release
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: "1.21.2"
args: release --debug --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GO_VERSION: "1.21.4"