diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a17829f..69ef969 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,6 +160,17 @@ jobs: - name: Build Artifacts run: nix build .#release --option warn-dirty false --print-build-logs + - name: Validate Artifacts + run: | + for f in $(find result/ -type f -not -name '*.sha256'); do + want=$(sha256sum "${f}" | head -c 64) + got=$(cat "${f}.sha256") + if [[ "${want}" != "${got}" ]]; then + echo "File ${f} has incorrect checksum; want ${want}, got ${got}" + exit 1 + fi + done + - name: Upload Artifacts uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: diff --git a/nix/build.nix b/nix/build.nix index 5dd1874..c016e13 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -45,6 +45,9 @@ let mv $out/bin/${platform.os}_${platform.arch}/* $out/bin/ rmdir $out/bin/${platform.os}_${platform.arch} fi + ''; + + postFixup = '' cd $out/bin sha256sum ${pname}${ext} | head -c 64 > ${pname}${ext}.sha256 '';