From 8ec072b9c92277c16e7b2bf714ab583048694277 Mon Sep 17 00:00:00 2001 From: Nicco Kunzmann Date: Wed, 3 Jul 2024 15:21:00 +0100 Subject: [PATCH] Check distribution build --- .github/workflows/tests.yml | 23 +++++++++++++++++++++-- CHANGES.rst | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9907ded..979bee4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,11 +71,29 @@ jobs: parallel-finished: true format: cobertura + test-distribution: + name: Check built package + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install wheel twine + - name: Build distribution files + run: python setup.py bdist_wheel sdist + - name: Check distribution files + run: twine check dist/* + deploy-tag-to-pypi: # only deploy on tags, see https://stackoverflow.com/a/58478262/1320237 if: startsWith(github.ref, 'refs/tags/v') needs: - run-tests + - test-distribution runs-on: ubuntu-latest # This environment stores the TWINE_USERNAME and TWINE_PASSWORD # see https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment @@ -92,7 +110,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip @@ -133,7 +151,8 @@ jobs: # only deploy on tags, see https://stackoverflow.com/a/58478262/1320237 if: startsWith(github.ref, 'refs/tags/v') needs: - - run-tests + - run-tests + - test-distribution runs-on: ubuntu-latest environment: name: github-release diff --git a/CHANGES.rst b/CHANGES.rst index f9af379..cec2b26 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -19,6 +19,7 @@ Minor changes: - Remove 4.x badge - Update list of ``tox`` environments - Use Coveralls' GitHub Action +- Check distribution in CI Breaking changes: