99 tags :
1010 - ' v[0-9]+.[0-9]+.[0-9]+*'
1111
12- defaults :
13- run :
14- shell : bash
15-
1612env :
1713 PACKAGE_NAME : labscript-devices
1814 SCM_LOCAL_SCHEME : no-local-version
@@ -41,26 +37,34 @@ jobs:
4137 strategy :
4238 matrix :
4339 include :
44- - { os: ubuntu-latest, python: 3.8, arch: x64 }
45- # - { os: ubuntu-latest, python: 3.7, arch: x64 }
46- # - { os: ubuntu-latest, python: 3.6, arch: x64 }
47-
48- # - { os: macos-latest, python: 3.8, arch: x64 }
49- # - { os: macos-latest, python: 3.7, arch: x64 }
50- # - { os: macos-latest, python: 3.6, arch: x64 }
51-
52- # - { os: windows-latest, python: 3.8, arch: x64 }
53- # - { os: windows-latest, python: 3.7, arch: x64 }
54- # - { os: windows-latest, python: 3.6, arch: x64 }
55-
56- # - { os: windows-latest, python: 3.8, arch: x86 }
57- # - { os: windows-latest, python: 3.7, arch: x86 }
58- # - { os: windows-latest, python: 3.6, arch: x86 }
40+ - { os: ubuntu-latest, python: '3.11', arch: x64, conda: true}
41+ # - { os: ubuntu-latest, python: '3.10', arch: x64, conda: true }
42+ # - { os: ubuntu-latest, python: '3.9', arch: x64, conda: true }
43+ # - { os: ubuntu-latest, python: '3.8', arch: x64, conda: true }
44+ # - { os: ubuntu-latest, python: '3.7', arch: x64, conda: true }
45+
46+ # - { os: macos-11, python: '3.11', arch: x64, conda: true }
47+ # - { os: macos-11, python: '3.10', arch: x64, conda: true }
48+ # - { os: macos-11, python: '3.9', arch: x64, conda: true }
49+ # - { os: macos-11, python: '3.8', arch: x64, conda: true }
50+ # - { os: macos-11, python: '3.7', arch: x64, conda: true }
51+
52+ # - { os: windows-latest, python: '3.11', arch: x64, conda: true }
53+ # - { os: windows-latest, python: '3.10', arch: x64, conda: true }
54+ # - { os: windows-latest, python: '3.9', arch: x64, conda: true }
55+ # - { os: windows-latest, python: '3.8', arch: x64, conda: true }
56+ # - { os: windows-latest, python: '3.7', arch: x64, conda: true }
57+
58+ # - { os: windows-latest, python: '3.11', arch: x86, conda: false } # conda not yet available
59+ # - { os: windows-latest, python: '3.10', arch: x86, conda: true }
60+ # - { os: windows-latest, python: '3.9', arch: x86, conda: true }
61+ # - { os: windows-latest, python: '3.8', arch: x86, conda: true }
62+ # - { os: windows-latest, python: '3.7', arch: x86, conda: true }
5963
6064 if : github.repository == 'labscript-suite/labscript-devices' && (github.event_name != 'create' || github.event.ref_type != 'branch')
6165 steps :
6266 - name : Checkout
63- uses : actions/checkout@v2
67+ uses : actions/checkout@v3
6468 with :
6569 fetch-depth : 0
6670
@@ -69,80 +73,74 @@ jobs:
6973 run : git tag -d $(git tag --points-at HEAD)
7074
7175 - name : Install Python
72- uses : actions/setup-python@v2
76+ uses : actions/setup-python@v4
7377 with :
7478 python-version : ${{ matrix.python }}
7579 architecture : ${{ matrix.arch }}
7680
7781 - name : Source Distribution
7882 if : strategy.job-index == 0
7983 run : |
80- python -m pip install --upgrade pip setuptools wheel pep517
81- python -m pep517. build -s .
84+ python -m pip install --upgrade pip setuptools wheel build
85+ python -m build -s .
8286
8387 - name : Wheel Distribution
8488 # Impure Linux wheels are built in the manylinux job.
8589 if : (env.PURE == 'true' && strategy.job-index == 0) || (env.PURE == 'false' && runner.os != 'Linux')
8690 run : |
87- python -m pip install --upgrade pip setuptools wheel pep517
88- python -m pep517. build -b .
91+ python -m pip install --upgrade pip setuptools wheel build
92+ python -m build -w .
8993
9094 - name : Upload Artifact
9195 if : strategy.job-index == 0 || (env.PURE == 'false' && runner.os != 'Linux')
92- uses : actions/upload-artifact@v2
96+ uses : actions/upload-artifact@v3
9397 with :
9498 name : dist
9599 path : ./dist
96100
97101 - name : Set Variables for Conda Build
102+ if : matrix.conda
103+ shell : bash
98104 run : |
99- if [ $RUNNER_OS == Windows ] && [ ${{ matrix.arch }} == x64 ]; then
100- CONDA_INSTALLER=Miniconda3-latest-Windows-x86_64.exe
101- elif [ $RUNNER_OS == Windows ]; then
102- CONDA_INSTALLER=Miniconda3-latest-Windows-x86.exe
103- elif [ $RUNNER_OS == Linux ]; then
104- CONDA_INSTALLER=Miniconda3-latest-Linux-x86_64.sh
105- else
106- CONDA_INSTALLER=Miniconda3-latest-MacOSX-x86_64.sh
107- fi
108105 if [ $NOARCH == true ]; then
109106 CONDA_BUILD_ARGS="--noarch"
110107 else
111108 CONDA_BUILD_ARGS=""
112109 fi
113- echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV
114110 echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
115111
112+ - name : Install Miniconda
113+ if : matrix.conda
114+ uses : conda-incubator/setup-miniconda@v2
115+ with :
116+ auto-update-conda : true
117+ python-version : ${{ matrix.python }}
118+ architecture : ${{ matrix.arch }}
119+ miniconda-version : " latest"
120+
121+ - name : Workaround conda-build incompatibility with xcode 12+
122+ if : runner.os == 'macOS'
123+ uses : maxim-lobanov/setup-xcode@v1
124+ with :
125+ xcode-version : 11.7
126+
116127 - name : Conda package (Unix)
117- if : runner.os != 'Windows'
128+ if : (matrix.conda && runner.os != 'Windows')
129+ shell : bash -l {0}
118130 run : |
119- curl -LO https://repo.continuum.io/miniconda/$CONDA_INSTALLER
120- bash "$CONDA_INSTALLER" -b -p .miniconda
121- source .miniconda/etc/profile.d/conda.sh
122- conda activate
123- conda update -n base -c defaults conda
124- conda create -n py${{ matrix.python }} python=${{ matrix.python }}
125- conda activate py${{ matrix.python }}
126- conda install -c cbillington setuptools-conda
127- pip install --upgrade setuptools_scm
131+ conda install -c labscript-suite setuptools-conda
128132 setuptools-conda build $CONDA_BUILD_ARGS .
129133
130134 - name : Conda Package (Windows)
131- if : runner.os == 'Windows'
132- shell : cmd
135+ if : (matrix.conda && runner.os == 'Windows')
136+ shell : cmd /C CALL {0}
133137 run : |
134- curl -LO https://repo.continuum.io/miniconda/%CONDA_INSTALLER%
135- %CONDA_INSTALLER% /S /D=%CD%\.miniconda && ^
136- .miniconda\Scripts\activate && ^
137- conda update -n base -c defaults conda && ^
138- conda create -n py${{ matrix.python }} python=${{ matrix.python }} && ^
139- conda activate py${{ matrix.python }} && ^
140- conda install -c cbillington setuptools-conda && ^
141- pip install --upgrade setuptools_scm && ^
142- setuptools-conda build %CONDA_BUILD_ARGS% .
138+ conda install -c labscript-suite setuptools-conda && ^
139+ setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb .
143140
144141 - name : Upload Artifact
145- uses : actions/upload-artifact@v2
142+ if : matrix.conda
143+ uses : actions/upload-artifact@v3
146144 with :
147145 name : conda_packages
148146 path : ./conda_packages
@@ -151,16 +149,11 @@ jobs:
151149 manylinux :
152150 name : Build Manylinux
153151 runs-on : ubuntu-latest
154- strategy :
155- matrix :
156- include :
157- - { python: 'cp36-cp36m cp37-cp37m cp38-cp38' }
158-
159152 if : github.repository == 'labscript-suite/labscript-devices' && (github.event_name != 'create' || github.event.ref_type != 'branch')
160153 steps :
161154 - name : Checkout
162155 if : env.PURE == 'false'
163- uses : actions/checkout@v2
156+ uses : actions/checkout@v3
164157 with :
165158 fetch-depth : 0
166159
@@ -170,16 +163,17 @@ jobs:
170163
171164 - name : Build Manylinux Wheels
172165 if : env.PURE == 'false'
173- uses : RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64
166+ uses : RalfG/python-wheels-manylinux-build@v0.4.2
174167 with :
175- python-versions : ${{ matrix.python }}
168+ python-versions : ' cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
169+ pre-build-command : ' git config --global --add safe.directory "*"'
176170
177171 - name : Upload Artifact
178172 if : env.PURE == 'false'
179- uses : actions/upload-artifact@v2
173+ uses : actions/upload-artifact@v3
180174 with :
181175 name : dist
182- path : wheelhouse /*manylinux*.whl
176+ path : dist /*manylinux*.whl
183177
184178 release :
185179 name : Release
@@ -188,73 +182,62 @@ jobs:
188182 steps :
189183
190184 - name : Download Artifact
191- uses : actions/download-artifact@v2
185+ uses : actions/download-artifact@v3
192186 with :
193187 name : dist
194188 path : ./dist
195189
196190 - name : Download Artifact
197- uses : actions/download-artifact@v2
191+ uses : actions/download-artifact@v3
198192 with :
199193 name : conda_packages
200194 path : ./conda_packages
201195
202- - name : Publish on TestPyPI
203- uses : pypa/gh-action-pypi-publish@master
204- with :
205- user : __token__
206- password : ${{ secrets.testpypi }}
207- repository_url : https://test.pypi.org/legacy/
208-
209196 - name : Get Version Number
210197 if : github.event.ref_type == 'tag'
211198 run : |
212199 VERSION="${GITHUB_REF/refs\/tags\/v/}"
213200 echo "VERSION=$VERSION" >> $GITHUB_ENV
214201
215- - name : Create GitHub Release
202+ - name : Create GitHub Release and Upload Release Asset
216203 if : github.event.ref_type == 'tag'
217- id : create_release
218- uses : actions/create-release@latest
204+ uses : softprops/action-gh-release@v1
219205 env :
220206 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
221207 with :
222208 tag_name : ${{ github.event.ref }}
223- release_name : ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
209+ name : ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
224210 draft : true
225211 prerelease : ${{ contains(github.event.ref, 'rc') }}
212+ files : ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
226213
227- - name : Upload Release Asset
228- if : github.event.ref_type == 'tag'
229- uses : actions/upload-release-asset@v1
230- env :
231- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
214+ - name : Publish on TestPyPI
215+ uses : pypa/gh-action-pypi-publish@release/v1
232216 with :
233- upload_url : ${{ steps.create_release.outputs.upload_url }}
234- asset_path : ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
235- asset_name : ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
236- asset_content_type : application/gzip
217+ user : __token__
218+ password : ${{ secrets.testpypi }}
219+ repository-url : https://test.pypi.org/legacy/
237220
238221 - name : Publish on PyPI
239222 if : github.event.ref_type == 'tag'
240- uses : pypa/gh-action-pypi-publish@master
223+ uses : pypa/gh-action-pypi-publish@release/v1
241224 with :
242225 user : __token__
243226 password : ${{ secrets.pypi }}
244227
245- - name : Install Miniconda and cloud client
246- run : |
247- curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
248- bash Miniconda3-latest-Linux-x86_64.sh -b -p .miniconda
249- source .miniconda/etc/profile.d/conda.sh
250- conda activate
251- conda install anaconda-client
228+ - name : Install Miniconda
229+ uses : conda-incubator/setup-miniconda@v2
230+ with :
231+ auto-update-conda : true
232+
233+ - name : Install Anaconda cloud client
234+ shell : bash -l {0}
235+ run : conda install anaconda-client
252236
253237 - name : Publish to Anaconda test label
254238 if : github.event.ref_type != 'tag'
239+ shell : bash -l {0}
255240 run : |
256- source .miniconda/etc/profile.d/conda.sh
257- conda activate
258241 anaconda \
259242 --token ${{ secrets.ANACONDA_API_TOKEN }} \
260243 upload \
@@ -263,10 +246,9 @@ jobs:
263246 conda_packages/*/*
264247
265248 - name : Publish to Anaconda main label
249+ shell : bash -l {0}
266250 if : github.event.ref_type == 'tag'
267251 run : |
268- source .miniconda/etc/profile.d/conda.sh
269- conda activate
270252 anaconda \
271253 --token ${{ secrets.ANACONDA_API_TOKEN }} \
272254 upload \
0 commit comments