Skip to content

Commit

Permalink
CI: Automate pypi wheel publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Nov 21, 2024
1 parent e54b7df commit 0537cb0
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and upload to PyPI

on:
workflow_dispatch:
release:
types: [published]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BEFORE_ALL: cd python

- uses: actions/upload-artifact@v4.4.0
with:
name: artifacts-${{ matrix.os }}
path: ./wheelhouse/*.whl

upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/arrow-nanoarrow/
permissions:
id-token: write
# TODO: add back in the below condition when productionalized
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4.1.8
with:
# unpacks default artifact into dist/
# https://github.com/actions/upload-artifact/issues/480#issuecomment-1937762859
pattern: artifacts-*
merge-multiple: true
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/ # currently pointing to test env

0 comments on commit 0537cb0

Please sign in to comment.