Skip to content

Commit f11eeb3

Browse files
feat: Add checksums for artifacts (#18483)
* feat: Add checksums for artifacts * add newline for code formatter * fix shellcheck ding * add extglob to expect.txt
1 parent 5cfb3e4 commit f11eeb3

File tree

4 files changed

+96
-1
lines changed

4 files changed

+96
-1
lines changed

.github/actions/spelling/expect.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ authsvc
4949
autobenches
5050
AUTOBUILD
5151
AUTODESPAWN
52-
AUTOPULL
5352
autodiscovered
5453
autodiscovery
5554
autogen
5655
autoinstalling
56+
AUTOPULL
5757
autospawn
5858
autospawning
5959
autotools
@@ -348,6 +348,7 @@ exitcodes
348348
exprhere
349349
extendedstatus
350350
extendee
351+
extglob
351352
extr
352353
extralight
353354
extrepo

.github/workflows/publish.yml

+68
Original file line numberDiff line numberDiff line change
@@ -762,3 +762,71 @@ jobs:
762762
release: "any-version"
763763
republish: "true"
764764
file: "target/artifacts/vector-${{ env.VECTOR_VERSION }}-1.armv7hl.rpm"
765+
766+
generate-sha256sum:
767+
name: Generate SHA256 checksums
768+
runs-on: ubuntu-20.04
769+
needs:
770+
- generate-publish-metadata
771+
- build-x86_64-unknown-linux-gnu-packages
772+
- build-x86_64-unknown-linux-musl-packages
773+
- build-aarch64-unknown-linux-musl-packages
774+
- build-aarch64-unknown-linux-gnu-packages
775+
- build-x86_64-apple-darwin-packages
776+
- build-x86_64-pc-windows-msvc-packages
777+
- build-armv7-unknown-linux-gnueabihf-packages
778+
- build-armv7-unknown-linux-musleabihf-packages
779+
env:
780+
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
781+
steps:
782+
- name: Checkout Vector
783+
uses: actions/checkout@v3
784+
with:
785+
ref: ${{ inputs.git_ref }}
786+
- name: Download staged package artifacts (aarch64-unknown-linux-gnu)
787+
uses: actions/download-artifact@v3
788+
with:
789+
name: vector-${{ env.VECTOR_VERSION }}-aarch64-unknown-linux-gnu
790+
path: target/artifacts
791+
- name: Download staged package artifacts (aarch64-unknown-linux-musl)
792+
uses: actions/download-artifact@v3
793+
with:
794+
name: vector-${{ env.VECTOR_VERSION }}-aarch64-unknown-linux-musl
795+
path: target/artifacts
796+
- name: Download staged package artifacts (x86_64-unknown-linux-gnu)
797+
uses: actions/download-artifact@v3
798+
with:
799+
name: vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-gnu
800+
path: target/artifacts
801+
- name: Download staged package artifacts (x86_64-unknown-linux-musl)
802+
uses: actions/download-artifact@v3
803+
with:
804+
name: vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-musl
805+
path: target/artifacts
806+
- name: Download staged package artifacts (x86_64-apple-darwin)
807+
uses: actions/download-artifact@v3
808+
with:
809+
name: vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin
810+
path: target/artifacts
811+
- name: Download staged package artifacts (x86_64-pc-windows-msvc)
812+
uses: actions/download-artifact@v3
813+
with:
814+
name: vector-${{ env.VECTOR_VERSION }}-x86_64-pc-windows-msvc
815+
path: target/artifacts
816+
- name: Download staged package artifacts (armv7-unknown-linux-gnueabihf)
817+
uses: actions/download-artifact@v3
818+
with:
819+
name: vector-${{ env.VECTOR_VERSION }}-armv7-unknown-linux-gnueabihf
820+
path: target/artifacts
821+
- name: Download staged package artifacts (armv7-unknown-linux-musleabihf)
822+
uses: actions/download-artifact@v3
823+
with:
824+
name: vector-${{ env.VECTOR_VERSION }}-armv7-unknown-linux-musleabihf
825+
path: target/artifacts
826+
- name: Generate SHA256 checksums for artifacts
827+
run: make sha256sum
828+
- name: Stage checksum for publish
829+
uses: actions/upload-artifact@v3
830+
with:
831+
name: vector-${{ env.VECTOR_VERSION }}-SHA256SUMS
832+
path: target/artifacts/vector-${{ env.VECTOR_VERSION }}-SHA256SUMS

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,10 @@ release-s3: ## Release artifacts to S3
624624
sync-install: ## Sync the install.sh script for access via sh.vector.dev
625625
@aws s3 cp distribution/install.sh s3://sh.vector.dev --sse --acl public-read
626626

627+
.PHONY: sha256sum
628+
sha256sum: ## Generate SHA256 checksums of CI artifacts
629+
scripts/checksum.sh
630+
627631
##@ Vector Remap Language
628632

629633
.PHONY: test-vrl

scripts/checksum.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# checksum.sh
5+
#
6+
# SUMMARY
7+
#
8+
# Creates a SHA256 checksum of all artifacts created during CI
9+
10+
ROOT=$(git rev-parse --show-toplevel)
11+
VECTOR_VERSION=${VECTOR_VERSION:-nightly}
12+
13+
pushd "${ROOT}/target/artifacts"
14+
15+
shopt -s extglob
16+
ARTIFACTS=$(ls !(*SHA256SUMS))
17+
shopt -u extglob
18+
19+
# shellcheck disable=SC2086 # Intended splitting of ARTIFACTS
20+
sha256sum $ARTIFACTS > vector-"$VECTOR_VERSION"-SHA256SUMS
21+
22+
popd

0 commit comments

Comments
 (0)