19
19
20
20
env :
21
21
GO111MODULE : on
22
- COSIGN_EXPERIMENTAL : " true"
22
+ COSIGN_YES : " true"
23
+
24
+ outputs :
25
+ hashes : ${{ steps.hash.outputs.hashes }}
26
+ tag_name : ${{ steps.tag.outputs.tag_name }}
23
27
24
28
steps :
25
29
- name : Check out code onto GOPATH
33
37
- name : Install cosign
34
38
uses : sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1
35
39
36
- - uses : ko-build/setup-ko@v0.6
40
+ - uses : ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
37
41
with :
38
42
version : v0.14.1
39
43
@@ -48,12 +52,15 @@ jobs:
48
52
goflags=$(ldflags)
49
53
echo "GO_FLAGS="${goflags}"" >> "$GITHUB_ENV"
50
54
55
+ - name : Log into ghcr.io
56
+ run : echo ${{ secrets.GITHUB_TOKEN }} | ko login ghcr.io -u ${{ github.repository_owner }} --password-stdin
57
+
51
58
- name : Run GoReleaser
52
59
id : run-goreleaser
53
60
uses : goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
54
61
with :
55
62
version : latest
56
- args : release --rm-dist
63
+ args : release --clean
57
64
env :
58
65
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
66
LDFLAGS : ${{ env.GO_FLAGS }}
@@ -67,32 +74,22 @@ jobs:
67
74
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
68
75
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
69
76
77
+ - name : build images
78
+ run : make build-sign-release-images || true
79
+ env :
80
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
81
+
70
82
provenance :
71
- needs : [release]
83
+ needs :
84
+ - release
85
+
72
86
permissions :
73
87
actions : read # To read the workflow path.
74
88
id-token : write # To sign the provenance.
75
89
contents : write # To add assets to a release.
90
+
76
91
uses : slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.7.0
77
92
with :
78
93
base64-subjects : " ${{ needs.release.outputs.hashes }}"
79
- upload-assets : false # do not upload to a new release since goreleaser creates it
80
-
81
- release-provenance :
82
- needs : [provenance]
83
- runs-on : ubuntu-latest
84
- permissions :
85
- actions : read # To read the workflow path.
86
- contents : write # To add assets to a release.
87
- steps :
88
- - name : Download the provenance
89
- uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
90
- with :
91
- name : ${{needs.provenance.outputs.provenance-name}}
92
-
93
- - name : Release Provenance
94
- uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
95
- id : release-provenance
96
- with :
97
- draft : true
98
- files : ${{needs.provenance.outputs.provenance-name}}
94
+ upload-assets : true # upload to a new release
95
+ upload-tag-name : " ${{ needs.release.outputs.tag_name }}"
0 commit comments