Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 45 additions & 13 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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/
Expand All @@ -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/
Expand Down Expand Up @@ -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/
Expand All @@ -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/
Expand All @@ -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: |
Expand All @@ -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: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >-
Expand Down Expand Up @@ -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 }}
Loading