Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building, testing and publishing wheels via GitHub Actions CI/CD #44

Merged
merged 18 commits into from
Nov 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build, test wheels & Publish

on: [push, pull_request]

jobs:
build_test_wheels:
name: Build & test wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: Install cibuildwheel & build
run: python -m pip install cibuildwheel==2.10.2 build

- name: Build wheels & test
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: yum install -y lksctp-tools-devel
#for now just a quick test of loopback
CIBW_TEST_COMMAND: python3 {project}/test_loopback.py
#skipping PyPy and musllinux builds
CIBW_SKIP: "pp* *musllinux*"

- name: Build sdist
run: python -m build --sdist -o wheelhouse

- uses: actions/upload-artifact@v3
with:
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
publish:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs:
- build_test_wheels
steps:
- name: setup python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4
- name: download artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist/
- name: publish built artifacts to test.pypi.org
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: publish built artifacts to pypi.org
if: ${{ startsWith(github.ref, 'refs/tag') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}