-
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (70 loc) · 2.23 KB
/
Copy pathrelease_go.yml
File metadata and controls
73 lines (70 loc) · 2.23 KB
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
65
66
67
68
69
70
71
72
73
name: goreleaser
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
description: 'The dockerhub username'
required: true
DOCKERHUB_TOKEN:
description: 'The dockerhub token'
required: true
AUR_KEY:
description: 'The AUR key'
required: true
NFPM_GPG_KEY:
description: 'The NFPM GPG key'
required: true
NFPM_DEFAULT_PASSPHRASE:
description: 'The NFPM GPG pass phrase'
required: true
workflow_dispatch:
permissions:
contents: write
packages: write
pull-requests: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: git fetch --force --tags
- run: |
echo "$NFPM_GPG_KEY" > ${{ runner.temp }}/nfpm_gpg.key
env:
NFPM_GPG_KEY: ${{ secrets.NFPM_GPG_KEY }}
- uses: anchore/sbom-action/download-syft@v0.17.8
- uses: actions/setup-go@v5
with:
go-version: stable
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: '~> v1'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
NFPM_GPG_KEY_PATH: ${{ runner.temp }}/nfpm_gpg.key
NFPM_DEFAULT_PASSPHRASE: ${{ secrets.NFPM_DEFAULT_PASSPHRASE }}