From 048832db7f1f9701fccbc7221735a1a7769d0bd2 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Mon, 27 Dec 2021 14:26:53 +0100 Subject: [PATCH] Split out a "publish" job --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 237aa650..ba4e1617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,10 @@ jobs: fetch-depth: 0 # required for setuptools_scm - name: Build sdist and temporary wheel run: pipx run build + - uses: actions/upload-artifact@v2 + with: + name: sdist + path: dist/*.tar.gz test: timeout-minutes: 10 @@ -55,32 +59,41 @@ jobs: - name: Upload coverage report uses: codecov/codecov-action@v1 - publish: + wheels: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: [lint, build, test] timeout-minutes: 10 runs-on: ubuntu-latest - needs: [lint, test] - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # required for setuptools_scm - name: Build wheels uses: pypa/cibuildwheel@v2.1.2 - with: - output-dir: dist/ env: CIBW_BUILD: "cp3*-manylinux_x86_64" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 CIBW_ENVIRONMENT: "CFLAGS=-g0" CIBW_TEST_COMMAND: "cutadapt --help" - - name: Set up Python - uses: actions/setup-python@v2 + - uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/*.whl + + publish: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: [build, wheels] + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: sdist + path: dist/ + - uses: actions/download-artifact@v2 with: - python-version: 3.7 - - name: Make sdist - run: | - pipx run build --sdist - ls -l dist/ + name: wheels + path: dist/ - name: Publish dev release to test PyPI if: contains(github.ref, '.dev') uses: pypa/gh-action-pypi-publish@v1.4.2