Skip to content

Commit

Permalink
CI: continue publishing wheels when non-release
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Aug 4, 2024
1 parent 6133254 commit 0eec3ee
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ main ]
release:
types: [ created ]
types: [ released, prereleased ]
pull_request: # also build on PRs touching this file
paths:
- ".github/workflows/release.yaml"
Expand Down Expand Up @@ -57,6 +57,7 @@ jobs:
build_wheels:
name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -163,36 +164,42 @@ jobs:
publish:
name: Publish on PyPI
needs: [make_sdist,build_wheels]
if: ${{ github.repository_owner == 'pyproj4' && github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- uses: actions/download-artifact@v4
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
with:
name: wheels-ubuntu-22.04-x86_64
path: dist
- uses: actions/download-artifact@v4
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
with:
name: wheels-macos-11-x86_64
name: wheels-macos-12-x86_64
path: dist
- uses: actions/download-artifact@v4
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
with:
name: wheels-macos-14-arm64
path: dist
- uses: actions/download-artifact@v4
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
with:
name: wheels-windows-2022-auto64
path: dist
- uses: actions/download-artifact@v4
continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }}
with:
name: wheels-windows-2022-auto32
path: dist

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


- name: Upload Nightly Wheels
- name: Upload Nightly Wheelsref
if : ${{ github.ref_type == "branch" && github.ref_name == "main" }}

This comment has been minimized.

Copy link
@matthewfeickert

matthewfeickert Aug 5, 2024

@snowman2 while I think you're already aware of this, the GitHub linter is throwing

The workflow is not valid. .github/workflows/release.yaml (Line: 212, Col: 14): Unexpected symbol: '"branch"'. Located at position 20 within expression: github.ref_type == "branch" && github.ref_name == "main"

on this. (c.f. https://github.com/pyproj4/pyproj/actions/runs/10232993838)

This comment has been minimized.

Copy link
@snowman2

snowman2 Aug 5, 2024

Author Member

Thank you! Yes, I am planning on addressing this when I get a free moment with a laptop.

This comment has been minimized.

Copy link
@matthewfeickert

matthewfeickert Aug 5, 2024

Great. Also sorry, I wasn't trying to be nosy or bug you — I just saw there wasn't an issue so wanted to double check that this hadn't gotten missed as the email notification stream can be endless.

uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc
with:
artifacts_path: dist
Expand Down

0 comments on commit 0eec3ee

Please sign in to comment.