Skip to content

Commit

Permalink
Release script and signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
pycanis committed Sep 17, 2024
1 parent d319046 commit 1b96830
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target
data
lnrecc.log
releases
lnrecc*
31 changes: 25 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
#!/bin/bash

# clear previous release

rm lnrecc*

# version input

version=$1

if [ -z "$version" ]; then
echo "Error: No version argument provided."
if [ -z $version ]; then
echo Error: No version argument provided.
exit 1
fi

# ARM64 darwin
cargo build --release

APP_NAME="lnrecc"
ARCHIVE_NAME="releases/${APP_NAME}-darwin-arm64-${version}.tar.gz"
APP_NAME=lnrecc
HASHES_NAME=$APP_NAME-$version.sha256.txt

ARCHIVE_NAME=$APP_NAME-darwin-arm64-$version.tar.gz

tar -czvf $ARCHIVE_NAME -C target/release $APP_NAME

shasum -a 256 $ARCHIVE_NAME >> $HASHES_NAME

# AMD64 linux

BUILD_IMAGE_NAME="lnrecc-build"
ARCHIVE_NAME="releases/${APP_NAME}-linux-amd64-${version}.tar.gz"
BUILD_IMAGE_NAME=lnrecc-build
ARCHIVE_NAME=$APP_NAME-linux-amd64-${version}.tar.gz

docker build -f Dockerfile-build -t ${BUILD_IMAGE_NAME} --platform linux/amd64 .

Expand All @@ -28,6 +38,15 @@ docker cp $container_id:/usr/src/app/target/release/$APP_NAME $APP_NAME

tar -czvf $ARCHIVE_NAME $APP_NAME

shasum -a 256 $ARCHIVE_NAME >> $HASHES_NAME

# sign hashes

echo GPG passphrase:
read -s passphrase

gpg --batch --pinentry-mode loopback --detach-sign --passphrase $passphrase $HASHES_NAME

# cleanup

rm $APP_NAME
Expand Down

0 comments on commit 1b96830

Please sign in to comment.