Skip to content

Commit 02d5cfc

Browse files
authored
Merge pull request #54 from dihm/update-workflow
Update workflow to match sandbox
2 parents bd5ad90 + 70aab50 commit 02d5cfc

File tree

1 file changed

+69
-85
lines changed

1 file changed

+69
-85
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ 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: runviewer
18-
SCM_VERSION_SCHEME: release-branch-semver
1914
SCM_LOCAL_SCHEME: no-local-version
2015
ANACONDA_USER: labscript-suite
2116

@@ -42,30 +37,30 @@ jobs:
4237
strategy:
4338
matrix:
4439
include:
45-
- { os: ubuntu-latest, python: 3.8, arch: x64 }
46-
#- { os: ubuntu-latest, python: 3.9, arch: x64 }
47-
#- { os: ubuntu-latest, python: 3.7, arch: x64 }
48-
#- { os: ubuntu-latest, python: 3.6, arch: x64 }
49-
50-
#- { os: macos-latest, python: 3.9, arch: x64 }
51-
#- { os: macos-latest, python: 3.8, arch: x64 }
52-
#- { os: macos-latest, python: 3.7, arch: x64 }
53-
#- { os: macos-latest, python: 3.6, arch: x64 }
54-
55-
#- { os: windows-latest, python: 3.9, arch: x64 }
56-
#- { os: windows-latest, python: 3.8, arch: x64 }
57-
#- { os: windows-latest, python: 3.7, arch: x64 }
58-
#- { os: windows-latest, python: 3.6, arch: x64 }
59-
60-
#- { os: windows-latest, python: 3.9, arch: x86 }
61-
#- { os: windows-latest, python: 3.8, arch: x86 }
62-
#- { os: windows-latest, python: 3.7, arch: x86 }
63-
#- { 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 }
6459

6560
if: github.repository == 'labscript-suite/runviewer' && (github.event_name != 'create' || github.event.ref_type != 'branch')
6661
steps:
6762
- name: Checkout
68-
uses: actions/checkout@v2
63+
uses: actions/checkout@v3
6964
with:
7065
fetch-depth: 0
7166

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

7671
- name: Install Python
77-
uses: actions/setup-python@v2
72+
uses: actions/setup-python@v4
7873
with:
7974
python-version: ${{ matrix.python }}
8075
architecture: ${{ matrix.arch }}
8176

8277
- name: Source Distribution
8378
if: strategy.job-index == 0
8479
run: |
85-
python -m pip install --upgrade pip setuptools wheel pep517
86-
python -m pep517.build -s .
80+
python -m pip install --upgrade pip setuptools wheel build
81+
python -m build -s .
8782
8883
- name: Wheel Distribution
8984
# Impure Linux wheels are built in the manylinux job.
9085
if: (env.PURE == 'true' && strategy.job-index == 0) || (env.PURE == 'false' && runner.os != 'Linux')
9186
run: |
92-
python -m pip install --upgrade pip setuptools wheel pep517
93-
python -m pep517.build -b .
87+
python -m pip install --upgrade pip setuptools wheel build
88+
python -m build -w .
9489
9590
- name: Upload Artifact
9691
if: strategy.job-index == 0 || (env.PURE == 'false' && runner.os != 'Linux')
97-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v3
9893
with:
9994
name: dist
10095
path: ./dist
10196

10297
- name: Set Variables for Conda Build
98+
shell: bash
10399
run: |
104-
if [ $RUNNER_OS == Windows ] && [ ${{ matrix.arch }} == x64 ]; then
105-
CONDA_INSTALLER=Miniconda3-latest-Windows-x86_64.exe
106-
elif [ $RUNNER_OS == Windows ]; then
107-
CONDA_INSTALLER=Miniconda3-latest-Windows-x86.exe
108-
elif [ $RUNNER_OS == Linux ]; then
109-
CONDA_INSTALLER=Miniconda3-latest-Linux-x86_64.sh
110-
else
111-
CONDA_INSTALLER=Miniconda3-latest-MacOSX-x86_64.sh
112-
fi
113100
if [ $NOARCH == true ]; then
114101
CONDA_BUILD_ARGS="--noarch"
115102
else
116103
CONDA_BUILD_ARGS=""
117104
fi
118-
echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV
119105
echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
120106
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+
121124
- name: Conda package (Unix)
122125
if: runner.os != 'Windows'
126+
shell: bash -l {0}
123127
run: |
124-
curl -LO https://repo.continuum.io/miniconda/$CONDA_INSTALLER
125-
bash "$CONDA_INSTALLER" -b -p .miniconda
126-
source .miniconda/etc/profile.d/conda.sh
127-
conda activate
128-
conda update -n base -c defaults conda
129-
conda create -n py${{ matrix.python }} python=${{ matrix.python }}
130-
conda activate py${{ matrix.python }}
131-
conda install -c cbillington setuptools-conda
132-
pip install --upgrade setuptools_scm
128+
conda install -c labscript-suite setuptools-conda
133129
setuptools-conda build $CONDA_BUILD_ARGS .
134130
135131
- name: Conda Package (Windows)
136132
if: runner.os == 'Windows'
137-
shell: cmd
133+
shell: cmd /C CALL {0}
138134
run: |
139-
curl -LO https://repo.continuum.io/miniconda/%CONDA_INSTALLER%
140-
%CONDA_INSTALLER% /S /D=%CD%\.miniconda && ^
141-
.miniconda\Scripts\activate && ^
142-
conda update -n base -c defaults conda && ^
143-
conda create -n py${{ matrix.python }} python=${{ matrix.python }} && ^
144-
conda activate py${{ matrix.python }} && ^
145-
conda install -c cbillington setuptools-conda && ^
146-
pip install --upgrade setuptools_scm && ^
147-
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 .
148137
149138
- name: Upload Artifact
150-
uses: actions/upload-artifact@v2
139+
uses: actions/upload-artifact@v3
151140
with:
152141
name: conda_packages
153142
path: ./conda_packages
@@ -156,16 +145,11 @@ jobs:
156145
manylinux:
157146
name: Build Manylinux
158147
runs-on: ubuntu-latest
159-
strategy:
160-
matrix:
161-
include:
162-
- { python: 'cp36-cp36m cp37-cp37m cp38-cp38' }
163-
164148
if: github.repository == 'labscript-suite/runviewer' && (github.event_name != 'create' || github.event.ref_type != 'branch')
165149
steps:
166150
- name: Checkout
167151
if: env.PURE == 'false'
168-
uses: actions/checkout@v2
152+
uses: actions/checkout@v3
169153
with:
170154
fetch-depth: 0
171155

@@ -175,16 +159,17 @@ jobs:
175159

176160
- name: Build Manylinux Wheels
177161
if: env.PURE == 'false'
178-
uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64
162+
uses: RalfG/python-wheels-manylinux-build@v0.4.2
179163
with:
180-
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 "*"'
181166

182167
- name: Upload Artifact
183168
if: env.PURE == 'false'
184-
uses: actions/upload-artifact@v2
169+
uses: actions/upload-artifact@v3
185170
with:
186171
name: dist
187-
path: wheelhouse/*manylinux*.whl
172+
path: dist/*manylinux*.whl
188173

189174
release:
190175
name: Release
@@ -193,19 +178,19 @@ jobs:
193178
steps:
194179

195180
- name: Download Artifact
196-
uses: actions/download-artifact@v2
181+
uses: actions/download-artifact@v3
197182
with:
198183
name: dist
199184
path: ./dist
200185

201186
- name: Download Artifact
202-
uses: actions/download-artifact@v2
187+
uses: actions/download-artifact@v3
203188
with:
204189
name: conda_packages
205190
path: ./conda_packages
206191

207192
- name: Publish on TestPyPI
208-
uses: pypa/gh-action-pypi-publish@master
193+
uses: pypa/gh-action-pypi-publish@release/v1
209194
with:
210195
user: __token__
211196
password: ${{ secrets.testpypi }}
@@ -247,19 +232,19 @@ jobs:
247232
user: __token__
248233
password: ${{ secrets.pypi }}
249234

250-
- name: Install Miniconda and cloud client
251-
run: |
252-
curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
253-
bash Miniconda3-latest-Linux-x86_64.sh -b -p .miniconda
254-
source .miniconda/etc/profile.d/conda.sh
255-
conda activate
256-
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
257243

258244
- name: Publish to Anaconda test label
259245
if: github.event.ref_type != 'tag'
246+
shell: bash -l {0}
260247
run: |
261-
source .miniconda/etc/profile.d/conda.sh
262-
conda activate
263248
anaconda \
264249
--token ${{ secrets.ANACONDA_API_TOKEN }} \
265250
upload \
@@ -268,10 +253,9 @@ jobs:
268253
conda_packages/*/*
269254
270255
- name: Publish to Anaconda main label
256+
shell: bash -l {0}
271257
if: github.event.ref_type == 'tag'
272258
run: |
273-
source .miniconda/etc/profile.d/conda.sh
274-
conda activate
275259
anaconda \
276260
--token ${{ secrets.ANACONDA_API_TOKEN }} \
277261
upload \

0 commit comments

Comments
 (0)