ci: Generate Python package with cibuildwheel #89
Workflow file for this run
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
name: gattlib | |
on: [push] | |
jobs: | |
build-debug: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: sudo apt install libbluetooth-dev | |
- run: mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make | |
build-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: sudo apt install libbluetooth-dev doxygen | |
- run: mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Release -DGATTLIB_BUILD_DOCS=ON .. && make | |
build-release-force-dbus: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: sudo apt install libbluetooth-dev | |
- run: mkdir build && pushd build && cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make | |
generate-python-binary-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: sudo apt install -y libbluetooth-dev | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
- run: ./ci/generate-python-package.sh | |
env: | |
CIBW_BEFORE_BUILD_LINUX: "sh ci/install-bluez.sh" | |
- name: Archive Python packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-binary-packages | |
path: dist/* | |
# publish-python-packages: | |
# needs: | |
# - generate-python-binary-packages | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/download-artifact@master | |
# - run: ls * | |
publish-to-pypi: | |
name: >- | |
Publish Python 🐍 distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
needs: | |
- generate-python-binary-packages | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/gattlib-py # Replace <package-name> with your PyPI project name | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- uses: actions/download-artifact@master | |
- run: | | |
ls * | |
mkdir dist/ | |
mv python-3.10-binary-package/*.tar.gz dist/ | |
mv python-*-binary-package/*.whl dist/ | |
ls dist/* | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |