Skip to content

Commit 30c6d2a

Browse files
authored
Merge pull request #19539 from k8s-infra-cherrypick-robot/cherry-pick-19520-to-release-3.6
[release-3.6] Add verify release assets GitHub workflow
2 parents 7850ff5 + 1fb0f68 commit 30c6d2a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
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)