Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Fix sed checks for CLI versioning #3486

Merged
merged 12 commits into from
Sep 7, 2023
6 changes: 5 additions & 1 deletion src/ci/set-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ GET_VERSION=${SCRIPT_DIR}/get-version.sh
VERSION=${1:-$(${GET_VERSION})}
cd ${SCRIPT_DIR}/../../

arrVer=(${VERSION//./ })
MAJOR=${arrVer[0]}
MINOR=${arrVer[1]}

SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version__.py"
SET_REQS="src/cli/requirements.txt"

sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS}
sed -i "s/onefuzztypes~=0.0.0/onefuzztypes==${VERSION}/" ${SET_REQS}
sed -i "s/onefuzztypes==0.0.0/onefuzztypes==${MAJOR}.${MINOR}.*/" ${SET_REQS}
2 changes: 1 addition & 1 deletion src/ci/unset-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_
SET_REQS="src/cli/requirements.txt"

sed -i 's/__version__ = .*/__version__ = "0.0.0"/' ${SET_VERSIONS}
sed -i "s/onefuzztypes==.*/onefuzztypes~=0.0.0/" ${SET_REQS}
sed -i "s/onefuzztypes==.*/onefuzztypes==0.0.0/" ${SET_REQS}
2 changes: 1 addition & 1 deletion src/cli/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ opentelemetry-instrumentation-requests==0.37b0
# install rsa version >=4.7 to fix CVE-2020-25658
rsa>=4.7
# onefuzztypes version is set during build
onefuzztypes~=0.0.0
onefuzztypes==0.0.0
Loading