From cde4502e7e7ca046a8426442f5f758e19e144ba4 Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Sun, 12 Jan 2025 17:42:17 +0200 Subject: [PATCH] update ipm_package script to takes ip name --- ipm_package.bash | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/ipm_package.bash b/ipm_package.bash index 57333e2..3b10572 100644 --- a/ipm_package.bash +++ b/ipm_package.bash @@ -1,10 +1,11 @@ #!/bin/bash +# to run use bash ipm_package.bash --version x.x.x --ip_name name # 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: +LONGOPTS=version:ip_name: OPTIONS= # -temporarily store output to be able to check for errors @@ -23,6 +24,11 @@ while true; do version="$2" shift 2 ;; + --) + --ip_name) + ip_name="$2" + shift 2 + ;; --) shift break @@ -37,19 +43,33 @@ done echo "+ version=$version" # zip needed files -tar czf v$version.tar.gz hdl/ef_util_lib.v fw + + +tar czf v$version.tar.gz --files-from <(find . | grep -v "\./verify" | grep -v "\./fw/Doxyfile" | grep -v "\./ipm_package.bash" | grep -v ".*\.dev\.v" | grep -v "\./hdl/rtl/bus_wrappers/dft" | grep -v "\.git" | grep -v "\.tar\.gz" | grep -v "\./ip" | grep -v "\./docs" | grep -v "\.\$"; ls "./ip/dependencies.json") +# 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' \ +# --include='*.c' \ +# * # get checksum shasum -a 256 v$version.tar.gz > v$version.tar.gz.sha256 +# update yaml +sed -i "s/version.*/version: v$version/" *.yaml +sed -i "s/date.*/date: $(date +"%Y-%m-%d")/" *.yaml + # create tag -git tag -a EF_IP_UTIL-v$version -m "Release version $version" -git push origin EF_IP_UTIL-v$version +git tag -a $ip_name-v$version -m "Release version $version" +git push origin $ip_name-v$version # create release set -x -if gh release view EF_IP_UTIL-v$version > /dev/null 2>&1; then - echo "Release EF_IP_UTIL-v$version already exists. Skipping..." +if gh release view $ip_name-v$version > /dev/null 2>&1; then + echo "Release $ip_name-v$version already exists. Skipping..." else - echo "Creating release EF_IP_UTIL-v$version..." - gh release create EF_IP_UTIL-v$version v$version.tar.gz -t "EF_IP_UTIL-v$version" --notes "sha256: $(cat v$version.tar.gz.sha256)" -fi \ No newline at end of file + echo "Creating release $ip_name-v$version..." + gh release create $ip_name-v$version v$version.tar.gz -t "$ip_name-v$version" --notes "sha256: $(cat v$version.tar.gz.sha256)" +fi