diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index 2c3d5ee9..0a5fb2ed 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -8,7 +8,32 @@ on: jobs: build: - name: 'py${{ matrix.python }} on ${{ matrix.os }}' + name: Build distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + submodules: true + fetch-depth: 0 + + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: '3.11' + + - name: Build sdist + run: | + python -m pip install -U pip build setuptools setuptools_scm wheel + python -m build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/* + + test: + name: 'Test py${{ matrix.python }} on ${{ matrix.os }}' + needs: [build] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -17,10 +42,10 @@ jobs: python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v5 + - uses: actions/download-artifact@v4 with: - submodules: true - fetch-depth: 0 + name: dist + path: dist - uses: actions/setup-python@v5 name: Install Python @@ -28,30 +53,17 @@ jobs: python-version: ${{ matrix.python }} allow-prereleases: true - - name: Build + - name: Install from sdist run: | - python -m pip install -U pip build twine setuptools setuptools_scm wheel - python -m build + python -m venv venv-test + venv-test/bin/python -m pip install dist/vplanet*.tar.gz - - name: Test the sdist + - name: Verify import run: | - python -m venv venv-sdist - venv-sdist/bin/python -m pip install dist/vplanet*.tar.gz - cd /tmp && "$GITHUB_WORKSPACE/venv-sdist/bin/python" -c "import vplanet; print(vplanet.__version__)" - - - name: Test the wheel - run: | - python -m venv venv-wheel - venv-wheel/bin/python -m pip install dist/vplanet*.whl - cd /tmp && "$GITHUB_WORKSPACE/venv-wheel/bin/python" -c "import vplanet; print(vplanet.__version__)" - - - uses: actions/upload-artifact@v4 - with: - name: dist-${{ matrix.os }}-${{ matrix.python }} - path: dist/* + cd /tmp && "$GITHUB_WORKSPACE/venv-test/bin/python" -c "import vplanet; print(vplanet.__version__)" upload_pypi: - needs: [build] + needs: [build, test] runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet' permissions: @@ -60,8 +72,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - pattern: dist-* + name: dist path: dist - merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/VERSION b/VERSION index 908153be..74f273ba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.35 +2.5.36