Skip to content

Commit 8674016

Browse files
Bring workflow up to date with the state of the art, add py311
1 parent 90a7791 commit 8674016

File tree

2 files changed

+52
-61
lines changed

2 files changed

+52
-61
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,34 @@ jobs:
3737
strategy:
3838
matrix:
3939
include:
40-
- { os: ubuntu-latest, python: 3.9, arch: x64 }
41-
- { os: ubuntu-latest, python: 3.8, arch: x64 }
42-
- { os: ubuntu-latest, python: 3.7, arch: x64 }
43-
- { os: ubuntu-latest, python: 3.6, arch: x64 }
44-
45-
- { os: macos-latest, python: 3.9, arch: x64 }
46-
- { os: macos-latest, python: 3.8, arch: x64 }
47-
- { os: macos-latest, python: 3.7, arch: x64 }
48-
- { os: macos-latest, python: 3.6, arch: x64 }
49-
50-
- { os: windows-latest, python: 3.9, arch: x64 }
51-
- { os: windows-latest, python: 3.8, arch: x64 }
52-
- { os: windows-latest, python: 3.7, arch: x64 }
53-
- { os: windows-latest, python: 3.6, arch: x64 }
54-
55-
- { os: windows-latest, python: 3.9, arch: x86 }
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-c-extensions' && (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,7 +73,7 @@ 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 }}
@@ -89,12 +93,13 @@ jobs:
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
98103
shell: bash
99104
run: |
100105
if [ $NOARCH == true ]; then
@@ -105,38 +110,37 @@ jobs:
105110
echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
106111
107112
- 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
113+
if: matrix.conda
114+
uses: conda-incubator/setup-miniconda@v2
112115
with:
113116
auto-update-conda: true
114117
python-version: ${{ matrix.python }}
115118
architecture: ${{ matrix.arch }}
116119
miniconda-version: "latest"
117120

118-
- name: Workaround conda-build incompatibility with xcode >12
121+
- name: Workaround conda-build incompatibility with xcode 12+
119122
if: runner.os == 'macOS'
120123
uses: maxim-lobanov/setup-xcode@v1
121124
with:
122125
xcode-version: 11.7
123126

124127
- name: Conda package (Unix)
125-
if: runner.os != 'Windows'
128+
if: (matrix.conda && runner.os != 'Windows')
126129
shell: bash -l {0}
127130
run: |
128131
conda install -c labscript-suite setuptools-conda
129132
setuptools-conda build $CONDA_BUILD_ARGS .
130133
131134
- name: Conda Package (Windows)
132-
if: runner.os == 'Windows'
135+
if: (matrix.conda && runner.os == 'Windows')
133136
shell: cmd /C CALL {0}
134137
run: |
135138
conda install -c labscript-suite setuptools-conda && ^
136139
setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb .
137140
138141
- name: Upload Artifact
139-
uses: actions/upload-artifact@v2
142+
if: matrix.conda
143+
uses: actions/upload-artifact@v3
140144
with:
141145
name: conda_packages
142146
path: ./conda_packages
@@ -145,16 +149,11 @@ jobs:
145149
manylinux:
146150
name: Build Manylinux
147151
runs-on: ubuntu-latest
148-
strategy:
149-
matrix:
150-
include:
151-
- { python: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' }
152-
153152
if: github.repository == 'labscript-suite/labscript-c-extensions' && (github.event_name != 'create' || github.event.ref_type != 'branch')
154153
steps:
155154
- name: Checkout
156155
if: env.PURE == 'false'
157-
uses: actions/checkout@v2
156+
uses: actions/checkout@v3
158157
with:
159158
fetch-depth: 0
160159

@@ -166,11 +165,12 @@ jobs:
166165
if: env.PURE == 'false'
167166
uses: RalfG/[email protected]
168167
with:
169-
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 "*"'
170170

171171
- name: Upload Artifact
172172
if: env.PURE == 'false'
173-
uses: actions/upload-artifact@v2
173+
uses: actions/upload-artifact@v3
174174
with:
175175
name: dist
176176
path: dist/*manylinux*.whl
@@ -182,56 +182,45 @@ jobs:
182182
steps:
183183

184184
- name: Download Artifact
185-
uses: actions/download-artifact@v2
185+
uses: actions/download-artifact@v3
186186
with:
187187
name: dist
188188
path: ./dist
189189

190190
- name: Download Artifact
191-
uses: actions/download-artifact@v2
191+
uses: actions/download-artifact@v3
192192
with:
193193
name: conda_packages
194194
path: ./conda_packages
195195

196-
- name: Publish on TestPyPI
197-
uses: pypa/gh-action-pypi-publish@release/v1
198-
with:
199-
user: __token__
200-
password: ${{ secrets.testpypi }}
201-
repository_url: https://test.pypi.org/legacy/
202-
203196
- name: Get Version Number
204197
if: github.event.ref_type == 'tag'
205198
run: |
206199
VERSION="${GITHUB_REF/refs\/tags\/v/}"
207200
echo "VERSION=$VERSION" >> $GITHUB_ENV
208201
209-
- name: Create GitHub Release
202+
- name: Create GitHub Release and Upload Release Asset
210203
if: github.event.ref_type == 'tag'
211-
id: create_release
212-
uses: actions/create-release@latest
204+
uses: softprops/action-gh-release@v1
213205
env:
214206
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
215207
with:
216208
tag_name: ${{ github.event.ref }}
217-
release_name: ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
209+
name: ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
218210
draft: true
219211
prerelease: ${{ contains(github.event.ref, 'rc') }}
212+
files: ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
220213

221-
- name: Upload Release Asset
222-
if: github.event.ref_type == 'tag'
223-
uses: actions/upload-release-asset@v1
224-
env:
225-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214+
- name: Publish on TestPyPI
215+
uses: pypa/gh-action-pypi-publish@release/v1
226216
with:
227-
upload_url: ${{ steps.create_release.outputs.upload_url }}
228-
asset_path: ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
229-
asset_name: ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
230-
asset_content_type: application/gzip
217+
user: __token__
218+
password: ${{ secrets.testpypi }}
219+
repository-url: https://test.pypi.org/legacy/
231220

232221
- name: Publish on PyPI
233222
if: github.event.ref_type == 'tag'
234-
uses: pypa/gh-action-pypi-publish@master
223+
uses: pypa/gh-action-pypi-publish@release/v1
235224
with:
236225
user: __token__
237226
password: ${{ secrets.pypi }}

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ classifiers =
1919
Programming Language :: Python :: 3.7
2020
Programming Language :: Python :: 3.8
2121
Programming Language :: Python :: 3.9
22+
Programming Language :: Python :: 3.10
23+
Programming Language :: Python :: 3.11
2224

2325
[options]
2426
zip_safe = False

0 commit comments

Comments
 (0)