Skip to content

Commit 0eec3ee

Browse files
committed
CI: continue publishing wheels when non-release
1 parent 6133254 commit 0eec3ee

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ main ]
66
release:
7-
types: [ created ]
7+
types: [ released, prereleased ]
88
pull_request: # also build on PRs touching this file
99
paths:
1010
- ".github/workflows/release.yaml"
@@ -57,6 +57,7 @@ jobs:
5757
build_wheels:
5858
name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }}
5959
runs-on: ${{ matrix.os }}
60+
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
6061
strategy:
6162
fail-fast: false
6263
matrix:
@@ -163,36 +164,42 @@ jobs:
163164
publish:
164165
name: Publish on PyPI
165166
needs: [make_sdist,build_wheels]
167+
if: ${{ github.repository_owner == 'pyproj4' && github.event_name != 'pull_request' }}
166168
runs-on: ubuntu-latest
167169
steps:
168170
- uses: actions/download-artifact@v4
169171
with:
170172
name: sdist
171173
path: dist
172174
- uses: actions/download-artifact@v4
175+
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
173176
with:
174177
name: wheels-ubuntu-22.04-x86_64
175178
path: dist
176179
- uses: actions/download-artifact@v4
180+
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
177181
with:
178-
name: wheels-macos-11-x86_64
182+
name: wheels-macos-12-x86_64
179183
path: dist
180184
- uses: actions/download-artifact@v4
185+
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
181186
with:
182187
name: wheels-macos-14-arm64
183188
path: dist
184189
- uses: actions/download-artifact@v4
190+
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
185191
with:
186192
name: wheels-windows-2022-auto64
187193
path: dist
188194
- uses: actions/download-artifact@v4
195+
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
189196
with:
190197
name: wheels-windows-2022-auto32
191198
path: dist
192199

193200
- name: Upload Wheels to PyPI
194201
# release on every tag
195-
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
202+
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' }}
196203
uses: pypa/gh-action-pypi-publish@release/v1
197204
with:
198205
user: __token__
@@ -201,7 +208,8 @@ jobs:
201208
# repository_url: https://test.pypi.org/legacy/ # To test
202209

203210

204-
- name: Upload Nightly Wheels
211+
- name: Upload Nightly Wheelsref
212+
if : ${{ github.ref_type == "branch" && github.ref_name == "main" }}
205213
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc
206214
with:
207215
artifacts_path: dist

0 commit comments

Comments
 (0)