-
Notifications
You must be signed in to change notification settings - Fork 115
64 lines (58 loc) · 1.96 KB
/
goreleaser.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
name: goreleaser
on:
push:
tags:
- v*
branches:
- main
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run GoReleaser for snapshot
# This does not actually publish anything, but makes sure that the images can be build
if: "!startsWith(github.ref, 'refs/tags/')"
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --snapshot --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Git is used to push helm chart to hetznercloud/helm-charts
- name: Setup Git
if: "startsWith(github.ref, 'refs/tags/')"
run: |
git config --global user.name hcloud-bot
git config --global user.email [email protected]
- name: Run GoReleaser for tag
if: "startsWith(github.ref, 'refs/tags/')"
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
# https://github.com/goreleaser/goreleaser/blob/3345f8c9c5b287198a29d3db228388148b788c5e/www/docs/customization/builds.md?plain=1#L416-L418
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHART_REPO_REMOTE: "https://${{ secrets.HCLOUD_BOT_TOKEN }}@github.com/hetznercloud/helm-charts"
- name: Clear
if: always()
run: rm -f ${HOME}/.docker/config.json