Skip to content

Commit 2e73b1f

Browse files
committed
Use github workflow to build sdist/wheel and upload.
use `build` to build both a sdist and a platform independant wheel on tagging.
1 parent 610db34 commit 2e73b1f

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

.github/workflows/releases.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Wheels
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_artifacts:
7+
name: Build wheel on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-18.04]
13+
env:
14+
CIBW_TEST_COMMAND: pytest --pyargs zarr
15+
CIBW_TEST_REQUIRES: pytest
16+
CIBW_SKIP: "*27* pp*"
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
with:
21+
submodules: true
22+
23+
- uses: actions/setup-python@v1
24+
name: Install Python
25+
with:
26+
python-version: '3.8'
27+
28+
- name: Install PyBuil
29+
run: |
30+
python -m pip install build
31+
32+
- name: Build wheel and sdist
33+
run: |
34+
python -m build
35+
- uses: actions/upload-artifact@v1
36+
with:
37+
name: releases
38+
path: dist
39+
40+
test_dist_pypi:
41+
needs: [build_artifacts]
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/download-artifact@v1
45+
with:
46+
name: releases
47+
path: dist
48+
49+
- name: test
50+
run: |
51+
ls
52+
ls dist
53+
54+
upload_pypi:
55+
needs: [build_artifacts]
56+
runs-on: ubuntu-latest
57+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
58+
steps:
59+
- uses: actions/download-artifact@v1
60+
with:
61+
name: releases
62+
path: dist
63+
64+
- uses: pypa/gh-action-pypi-publish@master
65+
with:
66+
user: __token__
67+
password: ${{ secrets.pypi_password }}
68+
# To test: repository_url: https://test.pypi.org/legacy/

docs/contributing.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ compatibility in some way.
330330
Release procedure
331331
~~~~~~~~~~~~~~~~~
332332

333+
.. note::
334+
335+
Most of the release process is now handled by github workflow which should
336+
automatically push a release to PyPI if a tag is pushed.
337+
333338
Checkout and update the master branch::
334339

335340
$ git checkout master
@@ -347,7 +352,6 @@ Tag the version (where "X.X.X" stands for the version number, e.g., "2.2.0")::
347352

348353
Release source code to PyPI::
349354

350-
$ python setup.py register sdist
351355
$ twine upload dist/zarr-${version}.tar.gz
352356

353357
Obtain checksum for release to conda-forge::

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=40.8.0", "wheel"]
3+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)