diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 60efcc2..8db6af5 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -12,6 +12,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 + - name: Check __version__ matches the tag + run: | + ver='${{ github.ref_name }}' + ver="${ver#v}" + pkg_ver=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' yt_xarray/__init__.py) + if [ "$pkg_ver" != "$ver" ]; then + echo "Tag version $ver does not match yt_xarray.__version__ ($pkg_ver); fix __init__.py before tagging." >&2 + exit 1 + fi + echo "yt_xarray.__version__ == $ver" - name: Extract section for this version run: | ver='${{ github.ref_name }}' diff --git a/yt_xarray/__init__.py b/yt_xarray/__init__.py index a2d1e23..68576c3 100644 --- a/yt_xarray/__init__.py +++ b/yt_xarray/__init__.py @@ -2,7 +2,7 @@ __author__ = """Chris Havlin""" __email__ = "chris.havlin@gmail.com" -__version__ = "0.4.2" +__version__ = "0.5.0" # import the xarray accessor so it is registered with xarray