Skip to content

Commit 1fb0f68

Browse files
ivanvck8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
Add verify released binary assets GitHub workflow
Signed-off-by: Ivan Valdes <ivan@vald.es>
1 parent 7850ff5 commit 1fb0f68

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Verify released binary assets
3+
permissions: read-all
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
verify-assets:
11+
name: Verify released binary assets
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Verify binary assets
15+
env:
16+
GH_TOKEN: ${{ github.token }}
17+
RELEASE: ${{ github.event.release.tag_name }}
18+
REPOSITORY: ${{ github.repository }}
19+
run: |
20+
mkdir github-assets
21+
pushd github-assets
22+
gh --repo "${REPOSITORY}" release download "${RELEASE}"
23+
24+
test_assets() {
25+
if [ "$(wc -l <SHA256SUMS)" != "$(find . -name 'etcd-*' | wc -l)" ]; then
26+
echo "::error:: Invalid number of assets"
27+
exit 1
28+
fi
29+
sha256sum -c SHA256SUMS
30+
}
31+
test_assets
32+
popd
33+
34+
mkdir google-assets
35+
for file in github-assets/*; do
36+
file=$(basename "${file}")
37+
echo "Downloading ${file} from Google..."
38+
curl "https://storage.googleapis.com/etcd/${RELEASE}/${file}" \
39+
--fail \
40+
-o "google-assets/${file}"
41+
done
42+
pushd google-assets
43+
44+
test_assets

0 commit comments

Comments
 (0)