diff --git a/.github/workflows/deploy_pypi.yml b/.github/workflows/deploy.yml similarity index 95% rename from .github/workflows/deploy_pypi.yml rename to .github/workflows/deploy.yml index 84434c9..7d4fa8f 100644 --- a/.github/workflows/deploy_pypi.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause -name: Publish package to Pypi +name: Publish package to Pypi and to the current release on: release: @@ -54,10 +54,10 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - github-release: + github-publish: name: Upload the release package to GitHub Release needs: - - pypi-publish + - release-packaging runs-on: ubuntu-22.04 permissions: contents: write # IMPORTANT: mandatory for making GitHub Releases diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c8faf15..b90732f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,12 +3,11 @@ # SPDX-License-Identifier: BSD-3-Clause -name: Execute code tests +name: Test the code, doc building, and packaging on: push: branches: [ "main" ] - tags: ["*"] pull_request: permissions: @@ -42,7 +41,6 @@ jobs: name: coverage-${{ matrix.pixi_environment }}-${{ matrix.os }} path: .coverage.${{ matrix.pixi_environment }}-${{ matrix.os }} - merge-coverage: name: Merge the coverage reports from multiple coverages needs: tests @@ -92,3 +90,30 @@ jobs: run: pixi run -e doc doc - name: Run doctests run: pixi run -e doc doctest + + test-packaging: + name: Package the project into a distributable file + runs-on: ubuntu-22.04 + steps: + - name: Checkout project + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install build dependencies + run: | + pip install --upgrade pip + pip install build + - name: Package the project to the dist dir + run: python -m build + - name: Try installing from the new dists + run: pip install dist/*.whl + - name: Produce a GitHub actions artifact (the distributable package) + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + if-no-files-found: error