-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 2.49 KB
/
release.yaml
File metadata and controls
71 lines (71 loc) · 2.49 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
name: release
on:
push:
branches:
- main
permissions: {}
jobs:
release-tag:
permissions:
# create tag
contents: write
runs-on: ubuntu-latest
outputs:
new-tag: ${{ steps.ccv.outputs.new-tag }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Bump tag if necessary
id: ccv
uses: smlx/ccv@7318e2f25a52dcd550e75384b84983973251a1f8 # v0.10.0
release-build:
permissions:
# create release
contents: write
# push docker images to registry
packages: write
# required by attest-build-provenance
id-token: write
attestations: write
needs: release-tag
if: needs.release-tag.outputs.new-tag == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: stable
# The setup-buildx-action enables the docker-container driver, which allows
# SBOM generation for the resulting container image using the syft
# container which is automatically pulled and run during the container
# image build. However, because the release process also generates an SBOM
# for the binaries attached to the GitHub release (see the "sboms" section
# in .goreleaser.yaml), it also needs to install syft into the action
# environment.
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: anchore/sbom-action/download-syft@17ae1740179002c89186b61233e0f892c3118b11 # v0.23.0
- name: Login to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
id: goreleaser
with:
version: latest
args: release --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# attest artifacts
- uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
with:
subject-checksums: ./dist/checksums.txt
# attest images
- uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
with:
subject-checksums: ./dist/digests.txt
push-to-registry: true