Skip to content

Commit

Permalink
add github action to release new packages
Browse files Browse the repository at this point in the history
  • Loading branch information
clobrano committed Jul 27, 2024
1 parent 0bcc54c commit 0d0bba0
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Python CI
name: Lestdo CI/CD

on:
push:
branches:
- main
- tags
pull_request:
workflow_dispatch:

Expand All @@ -30,3 +31,35 @@ jobs:
PYTHONPATH: ./src
run: |
pytest
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install --upgrade twine
twine upload dist/*

0 comments on commit 0d0bba0

Please sign in to comment.