diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d7b667e..e8b4374 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - build: + tests: name: "python ${{ matrix.python-version }} tests" runs-on: ubuntu-latest strategy: @@ -44,3 +44,25 @@ jobs: - name: Run unit tests run: | pytest . + + # Auto-publish when version is increased + publish: + # Only try to publish if: + # * Repo is self (prevents running from forks) + # * Branch is `main` + if: | + github.repository == 'google/xarray-beam' + && github.ref == 'refs/heads/main' + needs: tests # Only publish after tests are successful + runs-on: ubuntu-latest + permissions: + contents: write + timeout-minutes: 30 + + steps: + # Publish the package (if local `__version__` > pip version) + - uses: etils-actions/pypi-auto-publish@v1 + with: + pypi-token: ${{ secrets.PYPI_API_TOKEN }} + gh-token: ${{ secrets.GITHUB_TOKEN }} + parse-changelog: false diff --git a/setup.py b/setup.py index 7d8c282..83e6866 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setuptools.setup( name='xarray-tensorstore', - version='0.1.5', # keep in sync with xarray_tensorstore.py + version='0.2.0', # keep in sync with xarray_tensorstore.py license='Apache-2.0', author='Google LLC', author_email='noreply@google.com', diff --git a/xarray_tensorstore.py b/xarray_tensorstore.py index 0a97369..e9e5001 100644 --- a/xarray_tensorstore.py +++ b/xarray_tensorstore.py @@ -28,7 +28,7 @@ import zarr -__version__ = '0.1.5' # keep in sync with setup.py +__version__ = '0.2.0' # keep in sync with setup.py Index = TypeVar('Index', int, slice, np.ndarray, None) @@ -319,7 +319,7 @@ def _tensorstore_open_concatenated_zarrs( for k, spec in specs.items() } arrays_list.append(array_futures) - + # Concatenate the tensorstore arrays arrays = {} for k, axis in zip(data_vars, concat_axes, strict=True):