-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce release workflow for PyPI deployment 🚀
- Added `.github/workflows/release.yml` for automated release. - Set up different jobs for building and uploading artifacts: - Linux and macOS, both Intel and ARM architectures. - Removed `.github/workflows/test-and-deploy.yml` as it’s deprecated. - Ensured compatibility with Python 3.10 to 3.13. - Utilized `pipx` and `cibuildwheel` for reliable build processes.
- Loading branch information
Showing
2 changed files
with
147 additions
and
89 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,147 @@ | ||
name: 📦 Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
env: | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10,<3.14" | ||
|
||
jobs: | ||
make_sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
make_linux_intel_cp_wheels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup architecture | ||
run: | | ||
echo "CIBW_ARCHS_LINUX=x86_64" >> "$GITHUB_ENV" | ||
echo "CIBW_BUILD=cp*" >> "$GITHUB_ENV" | ||
- name: Build wheels | ||
run: pipx run cibuildwheel==2.22.0 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
make_linux_arm_cp_wheels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup architecture | ||
run: | | ||
echo "CIBW_ARCHS_LINUX=aarch64" >> "$GITHUB_ENV" | ||
echo "CIBW_BUILD=cp*" >> "$GITHUB_ENV" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
run: pipx run cibuildwheel==2.22.0 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
make_linux_intel_pp_wheels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup architecture | ||
run: | | ||
echo "CIBW_ARCHS_LINUX=x86_64" >> "$GITHUB_ENV" | ||
echo "CIBW_BUILD=pp*" >> "$GITHUB_ENV" | ||
- name: Build wheels | ||
run: pipx run cibuildwheel==2.22.0 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
make_linux_arm_pp_wheels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup architecture | ||
run: | | ||
echo "CIBW_ARCHS_LINUX=aarch64" >> "$GITHUB_ENV" | ||
echo "CIBW_BUILD=pp*" >> "$GITHUB_ENV" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
run: pipx run cibuildwheel==2.22.0 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
make_macos_intel_wheels: | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set macOS deployment target | ||
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV | ||
|
||
- name: Build wheels | ||
run: pipx run cibuildwheel==2.22.0 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
make_macos_arm_wheels: | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install autoconf | ||
run: brew install autoconf | ||
|
||
- name: Set macOS deployment target | ||
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV | ||
|
||
- name: Build wheels | ||
run: pipx run cibuildwheel==2.22.0 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
upload_all: | ||
needs: [make_linux_intel_cp_wheels, make_linux_arm_cp_wheels, make_linux_intel_pp_wheels, make_linux_arm_pp_wheels, make_macos_intel_wheels, make_macos_arm_wheels, make_sdist] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip-existing: true |
This file was deleted.
Oops, something went wrong.