-
Notifications
You must be signed in to change notification settings - Fork 31
48 lines (44 loc) · 1.46 KB
/
release.yml
File metadata and controls
48 lines (44 loc) · 1.46 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
name: goreleaser
on:
push:
# run only against tags
tags:
- "v0.[0-9]+.[0-9]+"
- "v1.[0-9]+.[0-9]+"
env:
GO_VERSION: 1.23
GO_RELEASER_VERSION: v2.4.7
permissions: {}
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
- name: Login to GitHub Container Registry to allow cosign signature push
run: echo "$DOCKER_PASSWORD" | docker login ghcr.io --username "$DOCKER_USERNAME" --password-stdin
env:
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
with:
distribution: goreleaser
version: ${{ env.GO_RELEASER_VERSION }} # Not pinnable by hash, nor does it verify its signature
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}