Debian Codegraph @

.github/workflows/verify-released-assets.yaml

raw
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