@@ -44,10 +44,16 @@ jobs:
44
44
os : [linux, darwin, freebsd, windows]
45
45
arch : [amd64, arm64]
46
46
runs-on : ubuntu-latest
47
+ permissions :
48
+ id-token : write
49
+ contents : read
50
+ attestations : write
47
51
needs : [create-draft-release]
48
52
steps :
49
53
- run : " echo \" RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
50
54
- uses : actions/checkout@v4
55
+ with :
56
+ fetch-depth : ' 0'
51
57
- uses : actions/setup-go@v5
52
58
with :
53
59
go-version : 1.22.x
@@ -60,19 +66,30 @@ jobs:
60
66
if [[ ${{ matrix.os }} == windows ]]; then
61
67
_filename=${_filename}.exe
62
68
fi
63
- mv cardano-node-api ${_filename}
69
+ cp cardano-node-api ${_filename}
64
70
curl \
65
71
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
66
72
-H "Content-Type: application/octet-stream" \
67
73
--data-binary @${_filename} \
68
74
https://uploads.github.com/repos/${{ github.repository_owner }}/cardano-node-api/releases/${{ needs.create-draft-release.outputs.RELEASE_ID }}/assets?name=${_filename}
75
+ - name : Attest binary
76
+ uses : actions/attest-build-provenance@v2
77
+ with :
78
+ subject-path : ' cardano-node-api'
69
79
70
80
build-images :
71
81
runs-on : ubuntu-latest
82
+ permissions :
83
+ id-token : write
84
+ contents : read
85
+ attestations : write
86
+ packages : write
72
87
needs : [create-draft-release]
73
88
steps :
74
89
- run : " echo \" RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
75
90
- uses : actions/checkout@v4
91
+ with :
92
+ fetch-depth : ' 0'
76
93
- name : Set up QEMU
77
94
uses : docker/setup-qemu-action@v3
78
95
- name : Set up Docker Buildx
@@ -102,12 +119,25 @@ jobs:
102
119
# semver
103
120
type=semver,pattern={{version}}
104
121
- name : Build images
122
+ id : push
105
123
uses : docker/build-push-action@v6
106
124
with :
107
125
outputs : " type=registry,push=true"
108
126
platforms : linux/amd64,linux/arm64
109
127
tags : ${{ steps.meta.outputs.tags }}
110
128
labels : ${{ steps.meta.outputs.labels }}
129
+ - name : Attest Docker Hub image
130
+ uses : actions/attest-build-provenance@v2
131
+ with :
132
+ subject-name : index.docker.io/blinklabs/cardano-node-api
133
+ subject-digest : ${{ steps.push.outputs.digest }}
134
+ push-to-registry : true
135
+ - name : Attest GHCR image
136
+ uses : actions/attest-build-provenance@v2
137
+ with :
138
+ subject-name : ghcr.io/${{ github.repository }}
139
+ subject-digest : ${{ steps.push.outputs.digest }}
140
+ push-to-registry : true
111
141
# Update Docker Hub from README
112
142
- name : Docker Hub Description
113
143
uses : peter-evans/dockerhub-description@v4
0 commit comments