diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 0000000000..fd69b75726 --- /dev/null +++ b/.github/workflows/releases.yml @@ -0,0 +1,57 @@ +name: Wheels + +on: [push, pull_request] + +jobs: + build_artifacts: + name: Build wheel on ubuntu-latest + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + - uses: actions/setup-python@v1 + name: Install Python + with: + python-version: '3.8' + + - name: Install PyBuild + run: | + python -m pip install build + + - name: Build wheel and sdist + run: | + python -m build + - uses: actions/upload-artifact@v1 + with: + name: releases + path: dist + + test_dist_pypi: + needs: [build_artifacts] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v1 + with: + name: releases + path: dist + + - name: test + run: | + ls + ls dist + + upload_pypi: + needs: [build_artifacts] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + steps: + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: repository_url: https://test.pypi.org/legacy/ diff --git a/docs/contributing.rst b/docs/contributing.rst index 1af3f8191a..b129c983e3 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -330,6 +330,11 @@ compatibility in some way. Release procedure ~~~~~~~~~~~~~~~~~ +.. note:: + + Most of the release process is now handled by github workflow which should + automatically push a release to PyPI if a tag is pushed. + Checkout and update the master branch:: $ git checkout master @@ -347,7 +352,6 @@ Tag the version (where "X.X.X" stands for the version number, e.g., "2.2.0"):: Release source code to PyPI:: - $ python setup.py register sdist $ twine upload dist/zarr-${version}.tar.gz Obtain checksum for release to conda-forge:: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..2f21011953 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta"