feat(ci): update ci wf #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to PyPi | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build twine wheel scmver setuptools | |
- name: Get version from setup.py | |
id: version | |
run: | | |
version=$(python3 setup.py --version) | |
echo "version=$version" >> $GITHUB_ENV | |
- name: Build package | |
run: python setup.py sdist bdist_wheel | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Create and push tag | |
run: | | |
git tag v$version | |
git push origin v$version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |