Skip to content

Commit

Permalink
More changes to build.sh and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Nov 14, 2023
1 parent c351329 commit ed990d5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ jobs:
draft: true
generate_release_notes: true
files: |
dist-*/*/*/*.bz2
dist-*/*/*/*.tar.bz2
dist-*/*/*/*.zip
34 changes: 24 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ VER="${VER#v}"
BUILD=$SRC/build
DIR=$BUILD/$PLATFORM/$ARCH/$VER

TAR=tar
EXT=tar.bz2
BIN=$DIR/$NAME

Expand All @@ -64,6 +65,11 @@ case $PLATFORM in
EXT=zip
BIN=$BIN.exe
;;
darwin)
if [ ! -z "$(which gtar|:)" ]; then
TAR=gtar
fi
;;
esac
OUT=$DIR/$NAME-$VER-$PLATFORM-$ARCH.$EXT

Expand Down Expand Up @@ -211,26 +217,34 @@ if [[ "$CHECK" == "1" ]]; then
echo "REPORTED: $BUILT_VER"
fi

(set -x;
file $BIN
)

# purge disk cache
if [[ "$PLATFORM" == "darwin" && "$CI" == "true" ]]; then
(set -x;
sudo /usr/sbin/purge
)
fi

# pack
cp $SRC/LICENSE $DIR
case $EXT in
tar.bz2)
tar -C $DIR -cjf $OUT $(basename $BIN) LICENSE
;;
zip)
zip $OUT -j $BIN LICENSE
;;
tar.bz2) $TAR -C $DIR -cjf $OUT $(basename $BIN) LICENSE ;;
zip) zip $OUT -j $BIN LICENSE ;;
esac

# report
echo "PACKED: $OUT ($(du -sh $OUT|awk '{print $1}'))"

case $EXT in
tar.bz2) tar -jvtf $OUT ;;
zip) unzip -l $OUT ;;
tar.bz2) (set -x; $TAR -jvtf $OUT) ;;
zip) (set -x; unzip -l $OUT) ;;
esac

echo "SHA256SUM:"
sha256sum $DIR/*
(set -x;
sha256sum $DIR/*
)

popd &> /dev/null

0 comments on commit ed990d5

Please sign in to comment.