Skip to content

Commit 1465d16

Browse files
authored
Add check version and tag (#301)
1 parent ad36b28 commit 1465d16

File tree

3 files changed

+21
-33
lines changed

3 files changed

+21
-33
lines changed

.github/workflows/python_publish.yaml renamed to .github/workflows/python-publish.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ jobs:
2323
run: |
2424
python -m pip install --upgrade pip
2525
pip install setuptools wheel twine
26+
- name: Check version
27+
run: |
28+
sh tools/check_version.sh ${GITHUB_REF#refs/*/}
2629
- name: Build and publish
2730
env:
2831
TWINE_REPOSITORY_URL: ${{ secrets.PYPI_REPOSITORY_URL }}
2932
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
3033
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
3134
run: |
32-
python setup.py sdist bdist_wheel
35+
python setup.py sdist
3336
twine upload dist/*

tools/check_version.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
TAG=$1
2+
TAG=`echo $TAG | sed -e "s/v//g"`
3+
4+
PACKAGE_NAME="rl_algorithms"
5+
6+
echo "A tag triggered build. $TAG"
7+
8+
VERSION=`cat "$PACKAGE_NAME"/version`
9+
echo "The version is $VERSION"
10+
11+
if [ "$VERSION" = "$TAG" ]; then
12+
echo "Version is correct! Deploy to local server."
13+
14+
else
15+
echo "Tag and version are not same. Check again."
16+
exit 1
17+
fi;

tools/update_version.py

-32
This file was deleted.

0 commit comments

Comments
 (0)