1- # This workflows will upload a Python Package using Twine when a release is created
1+ # This workflow will upload a Python Package using Twine when a release is created
22# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33
44name : test and deploy
88 branches :
99 - main
1010 tags :
11- - " v*" # Push events to matching v*, i.e. v1.0, v20.15.10
11+ - " v*" # Push events to matching v*, i.e., v1.0, v20.15.10
1212 pull_request :
1313 branches :
1414 - main
2020 runs-on : ${{ matrix.platform }}
2121 strategy :
2222 matrix :
23- # platform: [ubuntu-latest, windows-latest] # , macos-latest
2423 platform : [ubuntu-latest]
25- python-version : ['3.8', '3.9'] # issues with monai and 3.10; pausing for now. users should use python 3.9
24+ python-version : ['3.8', '3.9'] # Issues with monai and 3.10; pausing for now. Users should use Python 3.9.
2625
2726 steps :
2827 - uses : actions/checkout@v3
@@ -32,30 +31,29 @@ jobs:
3231 with :
3332 python-version : ${{ matrix.python-version }}
3433
35- # these libraries enable testing on Qt on linux
34+ # These libraries enable testing on Qt on Linux
3635 - uses : tlambert03/setup-qt-libs@v1
3736
38- # strategy borrowed from vispy for installing opengl libs on windows
37+ # Strategy borrowed from vispy for installing OpenGL libs on Windows
3938 - name : Install Windows OpenGL
4039 if : runner.os == 'Windows'
4140 run : |
4241 git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
4342 powershell gl-ci-helpers/appveyor/install_opengl.ps1
4443 if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}
4544
46- # note: if you need dependencies from conda, considering using
47- # setup-miniconda: https://github.com/conda-incubator/setup-miniconda
48- # and
49- # tox-conda: https://github.com/tox-dev/tox-conda
45+ # If you need dependencies from Conda, consider using:
46+ # setup-miniconda: https://github.com/conda-incubator/setup-miniconda
47+ # and tox-conda: https://github.com/tox-dev/tox-conda
5048 - name : Install dependencies
5149 run : |
5250 python -m pip install --upgrade pip
5351 python -m pip install setuptools tox tox-gh-actions
5452 python -m pip install napari_cellseg3d
5553
56- # this runs the platform-specific tests declared in tox.ini
54+ # This runs the platform-specific tests declared in tox.ini
5755 - name : Test with tox
58- uses : GabrielBB/xvfb-action@v1 # aganders3/headless-gui@v1
56+ uses : GabrielBB/xvfb-action@v1 # aganders3/headless-gui@v1
5957 with :
6058 run : python -m tox
6159 env :
@@ -65,31 +63,30 @@ jobs:
6563 uses : codecov/codecov-action@v2
6664
6765 deploy :
68- # This will run when you have tagged a commit starting with "v*"
6966 needs : [test]
70- runs-on : ubuntu -latest
67+ runs-on : macos -latest
7168 if : contains(github.ref, 'tags')
72-
69+
7370 steps :
7471 - uses : actions/checkout@v2
75-
72+
7673 - name : Set up Python
7774 uses : actions/setup-python@v2
7875 with :
79- python-version : " 3.8 " # Pin a specific version of Python (adjust if needed)
80-
76+ python-version : " 3.9 " # Specify Python 3.9
77+
8178 - name : Install dependencies
8279 run : |
8380 python -m pip install --upgrade pip
84- pip install -U setuptools setuptools_scm wheel twine build cibuildwheel
85-
81+ pip install -U setuptools wheel twine build
82+
8683 - name : Build and publish
8784 env :
8885 TWINE_USERNAME : __token__
8986 TWINE_PASSWORD : ${{ secrets.TWINE_API_KEY }}
9087 run : |
91- # Build the package with cibuildwheel for compatibility with manylinux
92- cibuildwheel --output-dir dist --python "cp38,cp39"
93-
88+ # Build the wheel for macOS and Python 3.9
89+ python -m build --wheel --sdist .
90+
9491 # Upload to PyPI using Twine
9592 twine upload dist/*
0 commit comments