Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaDuina authored Dec 19, 2024
1 parent 665f01b commit ed0803e
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
name: Publish Package

on:
workflow_run:
workflows: ["Check formatting and run tests"]
types:
- completed
push:
tags:
- 'v*' # This ensures the action runs only on version tags (e.g., v1.0.0)

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
MY_TEST: ${{ secrets.TEST }}

steps:
- name: Checkout the code
Expand All @@ -25,14 +20,20 @@ jobs:

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 - # Install Poetry
echo "$HOME/.poetry/bin" >> $GITHUB_PATH # Add Poetry to the PATH
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
run: |
poetry install --no-interaction --no-ansi
- name: Publish to PyPI
- name: Build the package
run: |
poetry config pypi-token.pypi $POETRY_PYPI_TOKEN_PYPI
poetry build
poetry publish --build -vv
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $POETRY_PYPI_TOKEN_PYPI
poetry publish --build --no-interaction --no-ansi

0 comments on commit ed0803e

Please sign in to comment.