Skip to content

Commit

Permalink
check version before creating sdist
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Apr 14, 2020
1 parent 1bdf0ff commit 3575e15
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ jobs:
echo "Expected error found in output: OK!"
git checkout master
echo "================================================================================================"
# specified version should match with current version
($GITHUB_WORKSPACE/scripts/create_source_tarball.sh ${{matrix.repo}} 0.0.0 2>&1 | tee $out) || true
grep "specified version '0.0.0' ... ERROR: Found version '${version}'" $out
echo "Expected error found in output: OK!"
echo "================================================================================================"
# existing source tarball in dist should result in an error
mkdir -p dist
touch dist/${{matrix.repo}}-${version}.tar.gz
Expand Down Expand Up @@ -134,14 +143,6 @@ jobs:
echo "================================================================================================"
# using of script with incorrect version should result in an error
($GITHUB_WORKSPACE/scripts/create_source_tarball.sh ${{matrix.repo}} 0.0.0 2>&1 | tee $out) || true
grep "ERROR: Expected file dist/${{matrix.repo}}-0.0.0.tar.gz not found!" $out
echo "Expected error found in output: OK!"
rm -f dist/${{matrix.repo}}-${version}.tar.gz MANIFEST
echo "================================================================================================"
# check use of script in correct way, should yield "SUCCESS" in output
$GITHUB_WORKSPACE/scripts/create_source_tarball.sh ${{matrix.repo}} $version 2>&1 | tee $out
grep SUCCESS $out
Expand Down
16 changes: 16 additions & 0 deletions scripts/create_source_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ else
error "Working directory not clean: `cat $out`"
fi

# check whether specified version matches current version
echo -n ">> checking whether current version matches specified version '$version' ... "
if [[ "$repo" == "easybuild-framework" ]]; then
curr_version_file='easybuild/tools/version.py'
elif [[ "$repo" == "easybuild-easyblocks" ]]; then
curr_version_file='easybuild/easyblocks/__init__.py'
else
curr_version_file='setup.py'
fi
curr_version=$(grep '^VERSION' $curr_version_file | sed 's/[^0-9]*\([0-9a-zA-Z.]*\).*/\1/g')
if [[ "$curr_version" == "$version" ]]; then
ok
else
error "Found version '$curr_version'"
fi

if [[ "$repo" == "easybuild-easyconfigs" ]]; then

# create index file
Expand Down

0 comments on commit 3575e15

Please sign in to comment.