Skip to content

Commit

Permalink
bash file to add new release
Browse files Browse the repository at this point in the history
  • Loading branch information
M0stafaRady committed Jan 9, 2025
1 parent 25d953f commit 7c982a3
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions ipm_package.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
# to run use bash ipm_package.bash --version x.x.x
# More safety, by turning some bugs into errors.
set -o errexit -o pipefail -o nounset

# now enjoy the options in order and nicely split until we see --
# option --output/-o requires 1 argument
LONGOPTS=version:
OPTIONS=

# -temporarily store output to be able to check for errors
# -activate quoting/enhanced mode (e.g. by writing out "--options")
# -pass arguments only via -- "$@" to separate them correctly
# -if getopt fails, it complains itself to stdout
PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@") || exit 2
# read getopt's output this way to handle the quoting right:
eval set -- "$PARSED"
unset PARSED


while true; do
case "$1" in
--version)
version="$2"
shift 2
;;
--)
shift
break
;;
*)
echo "Programming error"
exit 3
;;
esac
done

echo "+ version=$version"

# zip needed files
tar czf v$version.tar.gz --exclude='verify' --exclude='hdl/rtl/bus_wrappers/dft' --exclude='hdl/rtl/bus_wrappers/*.dev.v' --exclude='ipm_package.bash' --exclude='fw/Doxyfile' *
# get checksum
shasum -a 256 v$version.tar.gz > v$version.tar.gz.sha256

# # create tag
# git tag -a EF_UART-v$version -m "Release version $version"
# git push origin EF_UART-v$version

# # create release
# set -x
# if gh release view EF_UART-v$version > /dev/null 2>&1; then
# echo "Release EF_UART-v$version already exists. Skipping..."
# else
# echo "Creating release EF_UART-v$version..."
# gh release create EF_UART-v$version v$version.tar.gz -t "EF_UART-v$version" --notes "sha256: $(cat v$version.tar.gz.sha256)"
# fi

0 comments on commit 7c982a3

Please sign in to comment.