diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73137d2b..d2d1a6c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,26 @@ name: main on: [push, pull_request, workflow_dispatch] jobs: - build: + sdist: + name: Make source dist + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Create source dist + run: python setup.py sdist + - name: Upload source dist + uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist + if-no-files-found: error + + wheels: name: ${{ matrix.pyver }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} permissions: @@ -21,14 +40,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.10' - - name: Create source dist - run: python setup.py sdist - - name: Upload source dist - uses: actions/upload-artifact@v4 - with: - name: dist-${{ matrix.version }}-${{ matrix.pyver }}-${{ matrix.os }} - path: dist - if-no-files-found: error - name: Build and test wheels uses: pypa/cibuildwheel@v2.17 env: @@ -52,7 +63,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: wheels-${{ matrix.version }}-${{ matrix.pyver }}-${{ matrix.os }} - path: wheelhouse/ + path: wheelhouse/*.whl if-no-files-found: error publish: @@ -60,16 +71,16 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - needs: build - if: > - github.event_name == 'push' - && startsWith(github.ref, 'refs/tags') - && github.repository == 'Synss/python-mbedtls' + needs: [sdist, wheels] + # if: > + # github.event_name == 'push' + # && startsWith(github.ref, 'refs/tags') + # && github.repository == 'Synss/python-mbedtls' steps: - name: Download source packages uses: actions/download-artifact@v4 with: - pattern: dist-* + name: sdist path: dist - name: Download wheels uses: actions/download-artifact@v4 @@ -82,5 +93,6 @@ jobs: - name: Publish to pypi uses: pypa/gh-action-pypi-publish@release/v1 with: + repository-url: https://test.pypi.org/legacy/ user: __token__ password: ${{ secrets.PYPI_PASSWORD }}