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

Cross-platform binary packaging with cibuildwheel #451

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Tests

on:
pull_request:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on:
pull_request:
branches:
- '**'
push:
branches:
- master


jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v4

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

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[

=== Enhancements

* Pre-built binaries available on PyPI for Linux, Windows and macOS! ({uri-issue}451[#451])
* Support for RDP version 10.11 ({uri-issue}433[#433])
* Support for Python 3.11 by updating PyAV to get pre-built binary wheels ({uri-issue}437[#437], {uri-issue}438[#438])
* MITM start and termination log messages are now part of the JSON logs ({uri-issue}447[#447])
Expand All @@ -33,6 +34,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
* Added Python 3.10 tests on Windows to CI test configuration ({uri-issue}439[#439])
* Replaced Python 3.10 with Python 3.11 for CI test configuration ({uri-issue}438[#438])
* Added Ubuntu 20.04 in CI test configuration
* Using cibuildwheel for cross-platform and cross-python builds Windows, Linux, macOS ({uri-issue}451[#451])
* Deprecation cleanup in CI ({uri-issue}452[#452])


Expand Down
14 changes: 14 additions & 0 deletions docs/devel.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ docker images (latest, slim), on linux, on Windows
* sections, vim's: `%s/^=== \(.*\)$/## \1/gc`
* asciidoc links to markdown with vim: `%s/link:\([^\[]\+\)\(\[[^\[]\+\]\)/\2(\1)/gc`

.Upload binaries to PyPI

Instructions are partially from: https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/#manual-method

rm -rf dist/
# Make a source distribution
pipx run build --sdist

* Download packages built (called artifacts) by the https://github.com/GoSecure/pyrdp/actions/workflows/wheels.yml[Build workflow on GitHub] that are from the release commit
* Extract the zip in the dist/ directory

# Upload using 'twine'
pipx run twine upload dist/*

.Post-release
* Update version in `pyproject.toml` (+1 bugfix, append '.dev0') and commit
* commit msg: Begin development on next release
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ build-backend = "setuptools.build_meta"
name = "pyrdp"
description = "Remote Desktop Protocol (RDP) Monster-in-the-Middle tool and Python library"
readme = "README.md"
#license = "GPL-3.0-or-later"
# TODO automatically pull from this in the code
version = "1.2.1.dev0"
version = "2.0.0.rc1"
requires-python = ">=3.7"
authors = [
{ name = "Olivier Bilodeau", email = "obilodeau@gosecure.net" },
Expand Down
Loading