Skip to content

Commit

Permalink
CI/CD Pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish Mittapalle authored and Girish Mittapalle committed Oct 24, 2023
1 parent fa93389 commit 98339d1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
activate-conda: true
conda-channels: anaconda, conda-forge

- name: Install dependencies and Build HTML files
- name: Install required dependencies
run: |
conda install -c conda-forge graph-tool
pip install Sphinx
Expand All @@ -29,11 +29,22 @@ jobs:
python3 setup.py install
pip install sphinx-copybutton
pip install furo
pip install wheel
pip install twine
- name: Build HTML files
run: |
cd sphinx-build
make clean html
- name: Publish to Pypi
run: |
bash version_update.sh
python3 setup.py sdist bdist_wheel
twine upload dist/* -u ${{secrets.PYPI_USER}} -p ${{secrets.PYPI_PASSWORD}}
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: sphinx-build/_build/html
target-folder: docs
target-folder: docs
1 change: 0 additions & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__version_info__ = [0, 0, 6]
__version__ = '.'.join(map(str, __version_info__))
print(__version__)



14 changes: 14 additions & 0 deletions version_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
python_file1="version.py"

version=$(grep "__version_info__ =" "$python_file1" | sed 's/.*\[\(.*\)\].*/\1/')
sed -i -e "1s/s = .*/s = [$version]/" version_update.py
git add version_update.py
git commit -m "version update"
git push origin master

updated_version=$(python version_update.py)
sed -i -e "1s/__version_info__ = .*/__version_info__ = $updated_version/" version.py
git add version.py
git commit -m "version update"
git push origin master
rm *.py-e

0 comments on commit 98339d1

Please sign in to comment.