-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25d953f
commit 7c982a3
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |