Skip to content

Commit

Permalink
(#8) udpate ci
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Jan 14, 2025
1 parent b9c9851 commit 47a3f93
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,27 @@ jobs:
python -m pip install --upgrade pip
pip install build twine
- name: Check commit message for '[deploy]'
id: check-deploy
run: |
if ! git log -1 --pretty=%B | grep -q '\[deploy\]'; then
echo "No [deploy] tag found in the commit message. Skipping deployment."
exit 0
fi
- name: Build package
if: steps.check-deploy.outputs.result == 'true'
run: |
python -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
if: steps.check-deploy.outputs.result == 'true'
run: |
python -m twine upload \
--non-interactive \
--repository-url https://upload.pypi.org/legacy/ \
dist/*
python -m twine upload \
--non-interactive \
--repository-url https://upload.pypi.org/legacy/ \
dist/*
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 47a3f93

Please sign in to comment.