Skip to content

Commit

Permalink
test(ci): upload to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziqi-Yang committed Jul 31, 2024
1 parent 5d5e37b commit 5fdfbe5
Showing 1 changed file with 54 additions and 3 deletions.
57 changes: 54 additions & 3 deletions .github/workflows/buildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,31 @@ on:
workflow_dispatch:

jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build SDist
run: pipx run build --sdist

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
name: dist-sdist
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest, macos-14, windows-latest]

steps:
Expand All @@ -34,7 +52,40 @@ jobs:
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2

- uses: actions/upload-artifact@v4
- name: Upload wheels artifacts
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
name: dist-${{ matrix.os }}
path: ./wheelhouse/*.whl


merge_wheels:
name: Merge wheels into a combined artifact
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: dist
pattern: dist-*

pypi-publish:
name: Upload if release
needs: merge_wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/llvmpym
permissions:
id-token: write

steps:
- uses: actions/setup-python@v5

- uses: actions/download-artifact@v4
with:
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 5fdfbe5

Please sign in to comment.