@@ -3,10 +3,13 @@ name: PYPI wheels macos
33on :
44 release :
55 types : [created, edited]
6+
67 # push:
78 # branches:
89 # - dev
910
11+ workflow_dispatch :
12+
1013
1114jobs :
1215 deploy_to_pypi :
@@ -16,38 +19,56 @@ jobs:
1619 fail-fast : false
1720 matrix :
1821 os : [ 'macos-latest']
19- python-version : ['2.7', '3.7', '3.8']
22+ python-version : ['2.7', '3.7', '3.8', '3.9' ]
2023
2124 runs-on : ${{ matrix.os }}
2225
2326 steps :
24- - uses : actions/checkout@v2
25-
26- - name : Set up Python
27- uses : actions/setup-python@v1
28- with :
29- python-version : ${{ matrix.python-version }}
30-
31- - name : Install gfortran (macos)
32- run : |
33- brew cask install gfortran
34-
35- - name : Install dependencies
36- run : |
37- python -m pip install --upgrade pip
38- pip install setuptools wheel twine
39- pip install numpy
40- pip install scipy
41- pip install Cython
42- pip install delocate
43-
44- - name : Build the wheel
45- env :
46- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
47- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
48-
49- run : |
50-
51- python setup.py bdist_wheel
52- delocate-wheel -d -w fixed_wheels dist/*whl
53- twine upload fixed_wheels/*whl --skip-existing
27+ - name : Checkout
28+ uses : actions/checkout@v2
29+
30+ - name : Cache conda
31+ uses : actions/cache@v1
32+ env :
33+ # Increase this value to reset cache if etc/example-environment.yml has not changed
34+ CACHE_NUMBER : 1
35+ with :
36+ path : |
37+ ~/conda_pkgs_dir
38+ ~/.cache/pip
39+ ~/stripy/jupyterbook/_build
40+
41+ key : macos-test-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_test_environment.yml') }}
42+
43+ - name : Miniconda + Cache
44+ uses : conda-incubator/setup-miniconda@v2
45+ with :
46+ miniconda-version : " latest"
47+ auto-update-conda : true
48+ environment-file : .github/workflows/resources/conda_test_environment.yml
49+ activate-environment : conda-test
50+ python-version : 3.7
51+ use-only-tar-bz2 : true # IMPORTANT: This needs to be set for caching to work properly!
52+
53+ - name : Install (self)
54+ shell : bash -l {0}
55+ run : |
56+ pip install -e .
57+
58+ - name : Test with pytest
59+ shell : bash -l {0}
60+ run : |
61+ pip install setuptools wheel twine
62+ pip install delocate
63+
64+
65+ - name : Build the wheel
66+ shell : bash -l {0}
67+ env :
68+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
69+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
70+
71+ run : |
72+ python setup.py bdist_wheel
73+ delocate-wheel -d -w fixed_wheels dist/*whl
74+ twine upload fixed_wheels/*whl --skip-existing
0 commit comments