Skip to content

Commit

Permalink
👷 Add publish to pypi in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoPerrier committed Jan 15, 2024
1 parent f4a4435 commit 1b13165
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ jobs:
pip install tox tox-gh-actions
- name: Test with tox
run: tox

coverage:
name: Create coverage badge
needs: test
runs-on: ubuntu-latest
steps:
- name: Coverage Badge
uses: codecov/codecov-action@v3

deploy:
name: Deploy python package
needs: test
runs-on: ubuntu-latest
steps:
- run: echo "Deploying .."
29 changes: 29 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish to Pypi
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # regex to match semantic versioning tags

jobs:
tests:
uses: ./.github/workflows/main.yml
publish:
name: publish
needs: [main] # require main to pass before publish runs
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.10
- name: Build package
run: |
python -m pip install -U pip build
python -m build
- name: Publish
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 1b13165

Please sign in to comment.