Skip to content

Commit

Permalink
Add release job to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jun 25, 2024
1 parent d4fafce commit c93df63
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: CI
on: [push, pull_request]
name: CI/CD
on:
push:
branches: [main]
pull_request:
release:
types: [created]

jobs:
tests:
Expand Down Expand Up @@ -55,3 +60,28 @@ jobs:

- name: Run Tests
run: poetry run pytest --cov=iscc_sci --cov-report=xml -v tests

release:
needs: tests
if: github.event_name == 'release' && github.event.action == 'created' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.8.3

- name: Build package
run: poetry build

- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish

0 comments on commit c93df63

Please sign in to comment.