-
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.22 KB
/
go-release.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
name: Go Release
on:
push:
tags:
- 'v*'
permissions: {}
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
build-artifact: 'attest-goreleaser'
sbom-attestations: ${{ steps.upload-sbom.outputs.attestations }}
sbom-artifact: ${{ steps.upload-sbom.outputs.artifact }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: anchore/sbom-action/download-syft@v0
- uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean --fail-fast --skip=announce,publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
id: upload-build
with:
name: 'attest-goreleaser'
if-no-files-found: error
compression-level: 0
path: |
dist/vipdatasync_*/vipdatasync
dist/vipdatasync_*.tar.gz
dist/**/*.sbom.json
- uses: typisttech/tmp-attest-goreleaser-sbom-action@main
id: upload-sbom
attest-build:
runs-on: ubuntu-latest
needs: [goreleaser]
permissions:
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ needs.goreleaser.outputs.build-artifact }}
- uses: actions/attest-build-provenance@v1
with:
subject-path: |
vipdatasync_*.checksums.txt
vipdatasync_*/vipdatasync
vipdatasync_*.tar.gz
**/*.sbom.json
attest-sbom:
runs-on: ubuntu-latest
needs: [goreleaser]
permissions:
id-token: write
attestations: write
strategy:
matrix:
attestation: ${{ fromJSON(needs.goreleaser.outputs.sbom-attestations) }}
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ needs.goreleaser.outputs.sbom-artifact }}
- uses: actions/attest-sbom@v1
with:
subject-path: ${{ matrix.attestation.subject }}
sbom-path: ${{ matrix.attestation.sbom }}