-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Build and Upload | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_windows: | ||
name: Build wheels on Windows | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
env: | ||
CIBW_BUILD: "*win_amd64" | ||
CIBW_BUILD_FRONTEND: build | ||
uses: pypa/cibuildwheel@v2.21.3 | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-windows | ||
path: ./wheelhouse/*.whl | ||
|
||
build_macos: | ||
name: Build wheels on MacOS | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Xcode Switch | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest | ||
|
||
- name: Build | ||
env: | ||
CIBW_BUILD: "*mac*" | ||
CIBW_BUILD_FRONTEND: build | ||
MACOSX_DEPLOYMENT_TARGET: "13.3" | ||
uses: pypa/cibuildwheel@v2.21.3 | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-macos | ||
path: ./wheelhouse/*.whl | ||
|
||
build_linux: | ||
name: Build wheels on Linux | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
|
||
- name: Build | ||
run: | | ||
pipx run build | ||
platform="$(ldd --version | awk '/ldd/{gsub(/\./, "_", $NF); print "manylinux_" $NF "_x86_64"}')" | ||
pipx run wheel tags --remove --platform=${platform} dist/*linux_x86_64.whl | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-linux | ||
path: dist/*.whl | ||
|
||
build_sdist: | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: pipx run build --sdist | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sdist | ||
path: dist/*.tar.gz | ||
|
||
upload: | ||
name: Upload to PyPI | ||
needs: [build_windows, build_macos, build_linux, build_sdist] | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |