Skip to content

chore: updated version #6

chore: updated version

chore: updated version #6

Workflow file for this run

name: Upload Python Package
on:
push:
branches: [ main ]
pull_request:
types:
- opened
env:
PACKAGE_NAME: crawlab-ai
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements.txt
- name: Check version
run: |
version=$(python setup.py --version)
http_status=$(curl -o /dev/null -s -w "%{http_code}\n" https://pypi.org/project/${{ env.PACKAGE_NAME }}/${version}/)
if [[ "$http_status" == "404" ]]; then
echo "is_matched=1" >> $GITHUB_ENV
else
echo "is_matched=0" >> $GITHUB_ENV
fi
- name: Build and publish
if: ${{ env.is_matched == '1' }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
pip install twine
twine upload dist/*