Skip to content

Commit

Permalink
use poetry publish commands, create test gha
Browse files Browse the repository at this point in the history
  • Loading branch information
philiporlando committed Nov 23, 2024
1 parent 7c44a30 commit ad5cfdf
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 39 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/python-publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

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

- name: Configure Poetry
run: |
poetry config virtualenvs.create false
- name: Install dependencies
run: poetry install --only main

- name: Run Tests
run: poetry run pytest tests

- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish --build
43 changes: 43 additions & 0 deletions .github/workflows/python-publish-test-pypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to TestPyPI

on:
push:
branches:
- main # or the branch you want to test on (e.g., `develop`)
pull_request:

permissions:
contents: read

jobs:
test-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

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

- name: Configure Poetry
run: |
poetry config virtualenvs.create false

- name: Install dependencies
run: poetry install --only main

- name: Run Tests
run: poetry run pytest tests

- name: Publish to TestPyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: poetry publish --build --repository testpypi
39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

0 comments on commit ad5cfdf

Please sign in to comment.