From 7ee1532331f0c1c5949eef533288bb245cd19eb3 Mon Sep 17 00:00:00 2001 From: Mathias Laurin Date: Sat, 27 Apr 2024 16:28:25 +0200 Subject: [PATCH 1/2] wip: debug workflow upload/download artifacts --- .github/workflows/main.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73137d2b..7599e503 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,8 +26,9 @@ jobs: - name: Upload source dist uses: actions/upload-artifact@v4 with: - name: dist-${{ matrix.version }}-${{ matrix.pyver }}-${{ matrix.os }} + name: sdist path: dist + overwrite: True if-no-files-found: error - name: Build and test wheels uses: pypa/cibuildwheel@v2.17 @@ -52,7 +53,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: @@ -61,15 +62,15 @@ jobs: permissions: contents: read needs: build - if: > - github.event_name == 'push' - && startsWith(github.ref, 'refs/tags') - && github.repository == 'Synss/python-mbedtls' + # 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 +83,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 }} From ff83e1dcb35ebff5dc8c23b8e1becc5ca103ff83 Mon Sep 17 00:00:00 2001 From: Mathias Laurin Date: Sat, 27 Apr 2024 16:45:58 +0200 Subject: [PATCH 2/2] ci: Split sdist/wheels workflows --- .github/workflows/main.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7599e503..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,15 +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: sdist - path: dist - overwrite: True - if-no-files-found: error - name: Build and test wheels uses: pypa/cibuildwheel@v2.17 env: @@ -61,7 +71,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - needs: build + needs: [sdist, wheels] # if: > # github.event_name == 'push' # && startsWith(github.ref, 'refs/tags')