4848
4949 test-built-dist :
5050 needs : build-artifacts
51- if : github.event.release.prerelease
5251 runs-on : ubuntu-latest
5352 steps :
5453 - uses : actions/setup-python@v2
@@ -63,15 +62,23 @@ jobs:
6362 run : |
6463 ls -ltrh
6564 ls -ltrh dist
65+ upload-to-testpypi :
66+ needs : test-built-dist
67+ runs-on : ubuntu-latest
68+ steps :
69+ - uses : actions/download-artifact@v2
70+ with :
71+ name : releases
72+ path : dist
6673 - name : Publish package to TestPyPI
6774 uses : pypa/gh-action-pypi-publish@v1.4.2
75+ repository_url : https://test.pypi.org/legacy/
6876 with :
6977 user : __token__
7078 password : ${{ secrets.TESTPYPI_TOKEN }}
71- repository_url : https://test.pypi.org/legacy/
7279 verbose : true
7380 upload-to-pypi :
74- needs : test-built-dist
81+ needs : upload-to-testpypi
7582 if : " !github.event.release.prerelease"
7683 runs-on : ubuntu-latest
7784 steps :
@@ -86,11 +93,12 @@ jobs:
8693 password : ${{ secrets.PYPI_TOKEN }}
8794 verbose : true
8895 check-version-testpypi :
96+ needs : upload-to-testpypi
8997 runs-on : ubuntu-latest
9098 steps :
9199 - name : Check uploaded testpypi package
92100 run : |
93- sleep 10
101+ sleep 30
94102 python -m pip install --upgrade pip
95103 pip cache purge
96104 # This is kind of stupid, but the only way I got this to work with the latest versions on testpypi
@@ -102,11 +110,15 @@ jobs:
102110 python -m pip install --index-url https://test.pypi.org/simple --upgrade xarrayutils
103111 python -c "import xarrayutils;print(xarrayutils.__version__)"
104112 check-version-pypi :
105- runs-on : ubuntu-latest
106- steps :
107- - name : Check uploaded pypi package
108- run : |
109- python -m pip install --upgrade pip
110- python -m pip install --upgrade xarrayutils
111- python -c "import xarrayutils;print(xarrayutils.__version__)"
113+ needs : upload-to-pypi
114+ runs-on : ubuntu-latest
115+ steps :
116+ - name : Check uploaded pypi package
117+ run : |
118+ sleep 30
119+ python -m pip install --upgrade pip
120+ pip cache purge
121+ python -m pip install xarray dask numpy scipy #I thought this should happen automatically? I must still be packaging something wrong...
122+ python -m pip install --upgrade xarrayutils
123+ python -c "import xarrayutils;print(xarrayutils.__version__)"
112124
0 commit comments