diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml new file mode 100644 index 0000000..3d9d715 --- /dev/null +++ b/.github/workflows/python-publish.yaml @@ -0,0 +1,32 @@ +name: pypi-publish + +on: + release: + types: + - published + push: + branches: + - main + paths: + - '**/*.py' + - 'pyproject.toml' + workflow_dispatch: + +jobs: + pypi-publisher: + runs-on: thevickypedia-lite + steps: + - name: Set dry-run + run: | + if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "::notice title=DryRun::Setting dry run to true for '${{ github.event_name }}' event" + echo "dry_run=true" >> $GITHUB_ENV + else + echo "::notice title=DryRun::Setting dry run to false for '${{ github.event_name }}' event" + echo "dry_run=false" >> $GITHUB_ENV + fi + - uses: thevickypedia/pypi-publisher@v3 + env: + token: ${{ secrets.PYPI_TOKEN }} + with: + dry-run: ${{ env.dry_run }}