From 25b3972f8b36762cb03504f1969b76290b3da618 Mon Sep 17 00:00:00 2001 From: Danny Morabito Date: Mon, 24 Feb 2025 23:30:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20Implement=20build=20artifact=20h?= =?UTF-8?q?ash=20verification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ build.sh | 32 +++++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a8ab3fb..9f42321 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ node_modules dist out extras +# we are using bun, the package-json only exists after running the macos build +package-json.lock # Editor directories and files .vscode/* diff --git a/build.sh b/build.sh index 5ab3e03..061025b 100755 --- a/build.sh +++ b/build.sh @@ -22,7 +22,8 @@ cp ../Relay/dist/relay-x86_64-apple-darwin ./extras/macos/relay || error "Failed # Clean previous builds log "Cleaning previous builds..." -rm -rf dist +sudo rm -rf dist +sudo rm -rf out # Build Linux version log "Building Linux version..." @@ -43,5 +44,30 @@ VERSION=$(node -p "require('./package.json').version") log "Build complete! 🎉" echo "📦 Build artifacts:" echo "🐧 Linux AppImage: ./dist/Eve-${VERSION}.AppImage" -echo "🐧 Linux Flatpak: ./dist/Eve-${VERSION}.flatpak" -echo "🍎 macOS ZIP: ./dist/Eve-${VERSION}-mac.zip" \ No newline at end of file +echo "🐧 Linux Flatpak: ./dist/Eve-${VERSION}-x86_64.flatpak" +echo "🍎 macOS ZIP: ./dist/Eve-${VERSION}-mac.zip" + +log "Generating SHA256 hashes..." +echo "🔐 SHA256 Hashes:" +pushd dist +for file in "Eve-${VERSION}.AppImage" "Eve-${VERSION}-x86_64.flatpak" "Eve-${VERSION}-mac.zip"; do + if [ -f "$file" ]; then + shasum -a 256 "$file" | tee "$file.sha256" + echo "✅ Generated hash for $file" + else + echo "⚠️ Missing artifact: $file" + fi +done + +log "Generating SHA512 hashes..." +echo "🔐 SHA512 Hashes:" +for file in "Eve-${VERSION}.AppImage" "Eve-${VERSION}-x86_64.flatpak" "Eve-${VERSION}-mac.zip"; do + if [ -f "$file" ]; then + shasum -a 512 "$file" | tee "$file.sha512" + echo "✅ Generated hash for $file" + else + echo "⚠️ Missing artifact: $file" + fi +done + +popd \ No newline at end of file