Skip to content

Commit f23aca2

Browse files
authored
Merge pull request #101 from dihm/update-workflow
Bring workflow up to date with the sandbox
2 parents 5ec255a + 5c6a4a7 commit f23aca2

File tree

1 file changed

+69
-80
lines changed

1 file changed

+69
-80
lines changed

.github/workflows/release.yml

+69-80
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ on:
99
tags:
1010
- 'v[0-9]+.[0-9]+.[0-9]+*'
1111

12-
defaults:
13-
run:
14-
shell: bash
15-
1612
env:
1713
PACKAGE_NAME: labscript-devices
1814
SCM_LOCAL_SCHEME: no-local-version
@@ -41,26 +37,30 @@ 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.10', arch: x64 }
41+
# - { os: ubuntu-latest, python: '3.9', arch: x64 }
42+
- { os: ubuntu-latest, python: '3.8', arch: x64 }
43+
# - { os: ubuntu-latest, python: '3.7', arch: x64 }
44+
45+
# - { os: macos-latest, python: '3.10', arch: x64 }
46+
# - { os: macos-latest, python: '3.9', arch: x64 }
47+
# - { os: macos-latest, python: '3.8', arch: x64 }
48+
# - { os: macos-latest, python: '3.7', arch: x64 }
49+
50+
# - { os: windows-latest, python: '3.10', arch: x64 }
51+
# - { os: windows-latest, python: '3.9', arch: x64 }
52+
# - { os: windows-latest, python: '3.8', arch: x64 }
53+
# - { os: windows-latest, python: '3.7', arch: x64 }
54+
55+
# - { os: windows-latest, python: '3.10', arch: x86 }
56+
# - { os: windows-latest, python: '3.9', arch: x86 }
57+
# - { os: windows-latest, python: '3.8', arch: x86 }
58+
# - { os: windows-latest, python: '3.7', arch: x86 }
5959

6060
if: github.repository == 'labscript-suite/labscript-devices' && (github.event_name != 'create' || github.event.ref_type != 'branch')
6161
steps:
6262
- name: Checkout
63-
uses: actions/checkout@v2
63+
uses: actions/checkout@v3
6464
with:
6565
fetch-depth: 0
6666

@@ -69,80 +69,74 @@ jobs:
6969
run: git tag -d $(git tag --points-at HEAD)
7070

7171
- name: Install Python
72-
uses: actions/setup-python@v2
72+
uses: actions/setup-python@v4
7373
with:
7474
python-version: ${{ matrix.python }}
7575
architecture: ${{ matrix.arch }}
7676

7777
- name: Source Distribution
7878
if: strategy.job-index == 0
7979
run: |
80-
python -m pip install --upgrade pip setuptools wheel pep517
81-
python -m pep517.build -s .
80+
python -m pip install --upgrade pip setuptools wheel build
81+
python -m build -s .
8282
8383
- name: Wheel Distribution
8484
# Impure Linux wheels are built in the manylinux job.
8585
if: (env.PURE == 'true' && strategy.job-index == 0) || (env.PURE == 'false' && runner.os != 'Linux')
8686
run: |
87-
python -m pip install --upgrade pip setuptools wheel pep517
88-
python -m pep517.build -b .
87+
python -m pip install --upgrade pip setuptools wheel build
88+
python -m build -w .
8989
9090
- name: Upload Artifact
9191
if: strategy.job-index == 0 || (env.PURE == 'false' && runner.os != 'Linux')
92-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v3
9393
with:
9494
name: dist
9595
path: ./dist
9696

9797
- name: Set Variables for Conda Build
98+
shell: bash
9899
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
108100
if [ $NOARCH == true ]; then
109101
CONDA_BUILD_ARGS="--noarch"
110102
else
111103
CONDA_BUILD_ARGS=""
112104
fi
113-
echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV
114105
echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
115106
107+
- name: Install Miniconda
108+
# We need https://github.com/conda-incubator/setup-miniconda/pull/189 in order
109+
# to be able to install 32-bit miniconda on Windows. Once setup-miniconda 2.1.2
110+
# is released with this fix, can change to @v2.
111+
uses: conda-incubator/setup-miniconda@1a875d105ac03256664b54c882c8c374ce617ef6
112+
with:
113+
auto-update-conda: true
114+
python-version: ${{ matrix.python }}
115+
architecture: ${{ matrix.arch }}
116+
miniconda-version: "latest"
117+
118+
- name: Workaround conda-build incompatibility with xcode >12
119+
if: runner.os == 'macOS'
120+
uses: maxim-lobanov/setup-xcode@v1
121+
with:
122+
xcode-version: 11.7
123+
116124
- name: Conda package (Unix)
117125
if: runner.os != 'Windows'
126+
shell: bash -l {0}
118127
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
128+
conda install -c labscript-suite setuptools-conda
128129
setuptools-conda build $CONDA_BUILD_ARGS .
129130
130131
- name: Conda Package (Windows)
131132
if: runner.os == 'Windows'
132-
shell: cmd
133+
shell: cmd /C CALL {0}
133134
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% .
135+
conda install -c labscript-suite setuptools-conda && ^
136+
setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb .
143137
144138
- name: Upload Artifact
145-
uses: actions/upload-artifact@v2
139+
uses: actions/upload-artifact@v3
146140
with:
147141
name: conda_packages
148142
path: ./conda_packages
@@ -151,16 +145,11 @@ jobs:
151145
manylinux:
152146
name: Build Manylinux
153147
runs-on: ubuntu-latest
154-
strategy:
155-
matrix:
156-
include:
157-
- { python: 'cp36-cp36m cp37-cp37m cp38-cp38' }
158-
159148
if: github.repository == 'labscript-suite/labscript-devices' && (github.event_name != 'create' || github.event.ref_type != 'branch')
160149
steps:
161150
- name: Checkout
162151
if: env.PURE == 'false'
163-
uses: actions/checkout@v2
152+
uses: actions/checkout@v3
164153
with:
165154
fetch-depth: 0
166155

@@ -170,16 +159,17 @@ jobs:
170159

171160
- name: Build Manylinux Wheels
172161
if: env.PURE == 'false'
173-
uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64
162+
uses: RalfG/python-wheels-manylinux-build@v0.4.2
174163
with:
175-
python-versions: ${{ matrix.python }}
164+
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
165+
pre-build-command: 'git config --global --add safe.directory "*"'
176166

177167
- name: Upload Artifact
178168
if: env.PURE == 'false'
179-
uses: actions/upload-artifact@v2
169+
uses: actions/upload-artifact@v3
180170
with:
181171
name: dist
182-
path: wheelhouse/*manylinux*.whl
172+
path: dist/*manylinux*.whl
183173

184174
release:
185175
name: Release
@@ -188,19 +178,19 @@ jobs:
188178
steps:
189179

190180
- name: Download Artifact
191-
uses: actions/download-artifact@v2
181+
uses: actions/download-artifact@v3
192182
with:
193183
name: dist
194184
path: ./dist
195185

196186
- name: Download Artifact
197-
uses: actions/download-artifact@v2
187+
uses: actions/download-artifact@v3
198188
with:
199189
name: conda_packages
200190
path: ./conda_packages
201191

202192
- name: Publish on TestPyPI
203-
uses: pypa/gh-action-pypi-publish@master
193+
uses: pypa/gh-action-pypi-publish@release/v1
204194
with:
205195
user: __token__
206196
password: ${{ secrets.testpypi }}
@@ -242,19 +232,19 @@ jobs:
242232
user: __token__
243233
password: ${{ secrets.pypi }}
244234

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
235+
- name: Install Miniconda
236+
uses: conda-incubator/setup-miniconda@v2
237+
with:
238+
auto-update-conda: true
239+
240+
- name: Install Anaconda cloud client
241+
shell: bash -l {0}
242+
run: conda install anaconda-client
252243

253244
- name: Publish to Anaconda test label
254245
if: github.event.ref_type != 'tag'
246+
shell: bash -l {0}
255247
run: |
256-
source .miniconda/etc/profile.d/conda.sh
257-
conda activate
258248
anaconda \
259249
--token ${{ secrets.ANACONDA_API_TOKEN }} \
260250
upload \
@@ -263,10 +253,9 @@ jobs:
263253
conda_packages/*/*
264254
265255
- name: Publish to Anaconda main label
256+
shell: bash -l {0}
266257
if: github.event.ref_type == 'tag'
267258
run: |
268-
source .miniconda/etc/profile.d/conda.sh
269-
conda activate
270259
anaconda \
271260
--token ${{ secrets.ANACONDA_API_TOKEN }} \
272261
upload \

0 commit comments

Comments
 (0)