diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e1cca34..b83d7ee 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -21,12 +21,14 @@ jobs: build: name: Build package runs-on: ubuntu-latest + outputs: + version: ${{ steps.extract-version.outputs.version }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.14" @@ -43,8 +45,26 @@ jobs: run: | twine check dist/* + - name: Extract package version + id: extract-version + run: | + WHEEL_FILE=$(ls dist/*.whl) + # Extract version from wheel filename (format: griddataformats-VERSION-py3-none-any.whl) + VERSION=$(basename "$WHEEL_FILE" | sed -n 's/griddataformats-\([^-]*\)-.*/\1/p') + # Fallback: install wheel temporarily and get version + if [ -z "$VERSION" ]; then + # This is a bit dirty; running in a virtual environment would be cleaner. + # (pip install only works because our package's dependencies are easy to install.) + python -m pip install --upgrade pip + pip install "$WHEEL_FILE" --quiet + VERSION=$(python -c "import gridData; print(gridData.__version__)") + pip uninstall -y griddataformats --quiet + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Extracted version: $VERSION" + - name: Upload dist files - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: dist-files path: dist/ @@ -56,12 +76,12 @@ jobs: needs: build steps: - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.14" - name: Download dist files - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dist-files path: dist/ @@ -94,7 +114,7 @@ jobs: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Download dist files - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dist-files path: dist/ @@ -118,7 +138,7 @@ jobs: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Download dist files - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dist-files path: dist/ @@ -133,20 +153,26 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - needs: deploy-testpypi + needs: [build, deploy-testpypi] if: | github.repository == 'MDAnalysis/GridDataFormats' && (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) steps: - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.14" + - name: Checkout repository for actions + uses: actions/checkout@v6 + + - name: Wait for version to be available on TestPyPI (30 seconds) + run: sleep 30 + - name: Install from TestPyPI run: | python -m pip install --upgrade pip - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ GridDataFormats[test] + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ "GridDataFormats[test]==${{ needs.build.outputs.version }}" - name: Test import run: | @@ -163,20 +189,26 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - needs: deploy-pypi + needs: [build, deploy-pypi] if: | github.repository == 'MDAnalysis/GridDataFormats' && (github.event_name == 'release' && github.event.action == 'published') steps: - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.14" + - name: Checkout repository for actions + uses: actions/checkout@v6 + + - name: Wait for version to be available on PyPI (30 seconds) + run: sleep 30 + - name: Install from PyPI run: | python -m pip install --upgrade pip - pip install GridDataFormats[test] + pip install "GridDataFormats[test]==${{ needs.build.outputs.version }}" - name: Test import run: | diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2815d17..d22b3d6 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -21,17 +21,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: "Setup Micromamba" - uses: mamba-org/setup-micromamba@v2 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ci/environment.yaml environment-name: griddata_env create-args: >- - python=3.11 + python=3.14 init-shell: bash - name: install package @@ -43,7 +43,7 @@ jobs: cd doc && sphinx-build -b html source build - name: deploy docs - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 if: github.event_name != 'pull_request' with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index e464321..43cfcac 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -34,10 +34,10 @@ jobs: python-version: "3.14" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: setup_micromamba - uses: mamba-org/setup-micromamba@v2 + uses: mamba-org/setup-micromamba@v3 with: environment-name: mda create-args: >- @@ -67,10 +67,10 @@ jobs: pytest -v --cov=gridData --cov-report=xml --color=yes ./gridData/tests - name: codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v6 if: github.event_name != 'schedule' with: - file: coverage.xml + files: coverage.xml fail_ci_if_error: True verbose: True token: ${{ secrets.CODECOV_TOKEN }}