-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.67 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build
on:
workflow_call:
inputs:
snapshot:
description: "Whether to run in snapshot mode"
required: false
type: boolean
default: false
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
attestations: write
id-token: write
env:
CGO_ENABLED: 0
TAG: ${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@c4c114188661c0fa735e5b938764519fc6e8efa9
with:
go-version: 1.24.1
- name: Login to Docker Hub
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3
with:
distribution: goreleaser
version: v2.7.0
args: release --clean ${{ inputs.snapshot && '--snapshot' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2
if: success()
with:
subject-path: "dist/**/*"