-
Notifications
You must be signed in to change notification settings - Fork 137
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
102 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,102 @@ | ||
name: CD | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
build_wheels: | ||
name: Build wheel for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Set up QEMU | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install cibuildwheel | ||
- name: Build wheels | ||
env: | ||
CIBW_SKIP: "*-musllinux* pp*" | ||
CIBW_ARCHS_MACOS: "x86_64 arm64" | ||
CIBW_ARCHS_LINUX: "x86_64 aarch64" | ||
CIBW_BEFORE_BUILD_LINUX: "yum install -y libmemcached-devel" | ||
CIBW_BEFORE_BUILD_MACOS: "brew install libmemcached" | ||
run: | | ||
cibuildwheel --output-dir ./wheelhouse | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Build sdist | ||
run: | | ||
python setup.py sdist | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/*.tar.gz | ||
|
||
#upload_pypi: | ||
# needs: [build_wheels, build_sdist] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/download-artifact@v2 | ||
# with: | ||
# name: artifact | ||
# path: dist | ||
|
||
# - uses: actions/download-artifact@v2 | ||
# with: | ||
# name: wheels | ||
# path: dist | ||
|
||
# - name: Publish to PyPI | ||
# uses: pypa/gh-action-pypi-publish@master | ||
# with: | ||
# user: ${{ secrets.PYPI_USERNAME }} | ||
# password: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
release: | ||
name: Create GitHub release | ||
needs: | ||
- build_wheels | ||
- build_sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- name: Release on GitHub | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
wheels/*.whl | ||
dist/*.tar.gz |