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