Skip to content

Commit

Permalink
Testing Github Action for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
lericson committed Aug 5, 2022
1 parent a23abdc commit f2563ab
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/cd.yml
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

0 comments on commit f2563ab

Please sign in to comment.