From 296f1f2744c402b78292641444b6c81015aff6be Mon Sep 17 00:00:00 2001 From: yury-lysogorskiy Date: Mon, 24 Oct 2022 21:47:00 +0200 Subject: [PATCH] Update publish-to-test-pypi.yml --- .github/workflows/publish-to-test-pypi.yml | 52 +++++++++++++--------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index fb40dc3..93f576b 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,31 +1,39 @@ -name: Publish to TestPyPI -on: push +name: PyPi Release + +on: + push: + pull_request: + workflow_dispatch: + +# based on https://github.com/pypa/gh-action-pypi-publish jobs: - build-n-publish: - name: Build and publish Python distributions to TestPyPI - runs-on: ubuntu-18.04 + build: + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@master - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 with: - python-version: 3.8 - - name: Install pypa/build + python-version: "3.10" + + - name: Install dependencies run: >- - python -m - pip install - build - --user - - name: Build a binary wheel and a source tarball + python -m pip install --user --upgrade setuptools wheel + - name: Convert dependencies run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . + sed -i 's/==/>=/g' setup.py; cat setup.py + - name: Build + run: >- + python setup.py sdist bdist_wheel +# - name: Publish distribution 📦 to PyPI +# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' +# uses: pypa/gh-action-pypi-publish@master +# with: +# user: __token__ +# password: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/