From 15ab192bc752d46b1367fcec58bcfdd6425541bd Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Tue, 26 Jan 2021 09:20:41 -0500 Subject: [PATCH] Refactor to two stages build --- .github/workflows/publishing.yml | 36 ++++++++++++++++++----------- src/dependency_injector/__init__.py | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index c26a4e2e..97dc0471 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -7,32 +7,25 @@ on: jobs: - publish-source: - name: Publish source tarball + build-sdist: + name: Build source tarball runs-on: ubuntu-latest - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - TWINE_REPOSITORY: testpypi steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: 3.9 - run: python setup.py sdist - - run: pip install twine - - run: twine upload dist/* + - uses: actions/upload-artifact@v2 + with: + path: ./dist/* - publish-wheels: - name: Publish Linux wheels (x64) + build-wheels: + name: Build Linux wheels (x64) runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - TWINE_REPOSITORY: testpypi steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -48,6 +41,21 @@ jobs: with: path: ./wheelhouse/*.whl + upload-to-pypi: + name: Publish on PyPI + needs: [build-sdist, build-wheels] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + # - services: docker # arch: arm64 # if: tag IS present diff --git a/src/dependency_injector/__init__.py b/src/dependency_injector/__init__.py index a8088d64..a04c3f04 100644 --- a/src/dependency_injector/__init__.py +++ b/src/dependency_injector/__init__.py @@ -1,6 +1,6 @@ """Top-level package.""" -__version__ = '4.10.3dev3' +__version__ = '4.10.3dev4' """Version number. :type: str