forked from tomasbasham/shared-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (58 loc) · 1.69 KB
/
Copy pathgoreleaser.yaml
File metadata and controls
58 lines (58 loc) · 1.69 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
---
name: publish
on:
workflow_call:
inputs:
container-registry:
description: Container registry hostname (e.g. ghcr.io, docker.io)
type: string
container-username:
description: Registry username
type: string
goreleaser-version:
description: Version of GoReleaser Action to use
type: string
default: ~> v2
secrets:
CONTAINER_PASSWORD:
description: Registry password or token for authentication
GPG_PRIVATE_KEY:
description: GPG private key for signing releases
required: true
GPG_PASSPHRASE:
description: Passphrase for the GPG private key
required: true
permissions:
contents: write
packages: write
jobs:
goreleaser:
name: Publish artefacts to GitHub
runs-on: ubuntu-latest
steps:
- name: Login to GHCR
if: inputs.container-registry != ''
uses: docker/login-action@v4
with:
registry: ${{ inputs.container-registry }}
username: ${{ inputs.container-username }}
password: ${{ secrets.CONTAINER_PASSWORD }}
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Import GPG keys
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- uses: goreleaser/goreleaser-action@v7
with:
version: ${{ inputs.goreleaser-version }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}