Skip to content

Commit

Permalink
Allow to publish on default pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
alorence committed Mar 3, 2022
1 parent 35bc0cb commit 2935b4e
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ env:
POETRY_VIRTUALENVS_CREATE: false

on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags: ["*"]
# Manually triggered workflow
workflow_dispatch:
inputs:
target_repo:
description: 'The repository to publish package on'
required: true
default: 'pypi.org'
type: choice
options:
- pypi.org
- test.pypi.org

jobs:
publish:
Expand All @@ -20,7 +30,16 @@ jobs:
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ env.INSTALL_POETRY_VERSION }}

- name: Publish on Pypi
if: "${{ inputs.target_repo == 'pypi.org' }}"
run: |
echo "Publish on pypi.org"
# poetry publish --build -u __token__ -p ${{ secrets.PYPI_AUTH_TOKEN }}

- name: Publish on TestPypi
if: "${{ inputs.target_repo == 'test.pypi.org' }}"
run: |
echo "Publish on test.pypi.org"
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --build -u __token__ -p ${{ secrets.TEST_PYPI_SECRET }} -r testpypi
# poetry publish --build -u __token__ -p ${{ secrets.PYPI_AUTH_TOKEN_TEST }} -r testpypi

0 comments on commit 2935b4e

Please sign in to comment.