From cb6a62efba9660bbc2571500c9451ddf730064f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Behrmann?= Date: Tue, 27 Oct 2026 11:03:06 +0100 Subject: [PATCH 1/3] ci: bump action versions - actions/checkout -> v7 - github/codeql-action -> v4 --- .github/workflows/build.yml | 4 ++-- .github/workflows/codeql.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a4e645..2fa5ef7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,10 +40,10 @@ jobs: name: Python ${{ matrix.python }} on ${{ matrix.os }} steps: - name: Repository checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Configure Python ${{ matrix.python }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python }} architecture: x64 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0e799f1..4cded0f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -33,10 +33,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} queries: +security-extended,security-and-quality @@ -48,7 +48,7 @@ jobs: python -m pip install -U --break-system-packages pip build - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@v4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 From da49558a90eaa746326db33f805f94540b8cf4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Behrmann?= Date: Tue, 27 Oct 2026 11:03:55 +0100 Subject: [PATCH 2/3] ci: add Python 3.15 to build matrix --- .github/workflows/build.yml | 1 + pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fa5ef7..7d257fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: "3.12", "3.13", "3.14", + "3.15", ] exclude: - os: "ubuntu-22.04" diff --git a/pyproject.toml b/pyproject.toml index 2871ebc..9838648 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Logging", "Topic :: System :: Systems Administration", From 75348ca74462c8b052039aba38ecc2703b1d6bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Behrmann?= Date: Tue, 27 Oct 2026 12:03:28 +0100 Subject: [PATCH 3/3] ci: add pypi-publish workflow This adds a new workflow pypi-publish that builds wheels using the pypa/cibuildwheel GitHub action and a Python source distribution (sdist) via the build module (run via pipx, which is included in the runner images) and uploads them to PyPI via pypa/gh-action-pypi-publish using the trused publishing mechanism. --- .github/workflows/pypi-publish.yml | 109 +++++++++++++++++++++++++++++ pyproject.toml | 7 ++ 2 files changed, 116 insertions(+) create mode 100644 .github/workflows/pypi-publish.yml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..a8df009 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,109 @@ +name: Build and publish Python package to TestPyPI +on: + pull_request: + push: + branches: + - main + release: + types: [published] + +jobs: + build_wheels: + name: Build wheel cp${{ matrix.python }}-${{ matrix.manylinux_platform }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + python: 39 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 310 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 311 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 312 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 313 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 314 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 314t + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 315 + manylinux_platform: manylinux_x86_64 + - os: ubuntu-latest + python: 315t + manylinux_platform: manylinux_x86_64 + + steps: + - name: Checkout python-systemd for wheel build + uses: actions/checkout@v7 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Set SOURCE_DATE_EPOCH from source commit + run: | + printf "SOURCE_DATE_EPOCH=%s\n" "$(git log -1 --pretty=%ct)" >>"$GITHUB_ENV" + + - name: Build wheels + uses: pypa/cibuildwheel@8c2dcd2e96041a619f5ff03c9638d7941e2553a4 # v4.3.3 + env: + SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }} + with: + only: cp${{ matrix.python }}-${{ matrix.manylinux_platform }} + + - name: Store built wheels + uses: actions/upload-artifact@v7 + with: + name: cibw-wheels-${{ matrix.os }}-cp${{ matrix.python }}-${{ matrix.manylinux_platform }} + path: ./wheelhouse/*.whl + + make_sdist: + name: Make sdist + runs-on: ubuntu-latest + steps: + - name: Checkout python-systemd for source distribution build + uses: actions/checkout@v7 + with: + fetch-depth: 0 + persist-credentials: false + + - name: install libsystemd + run: | + sudo apt-get --update -y install libsystemd-dev + + - name: Build sdist + run: pipx run build --sdist + + - name: Store built sdist + uses: actions/upload-artifact@v7 + with: + name: cibw-sdist + path: ./dist/*.tar.gz + + upload_all: + needs: [build_wheels, make_sdist] + environment: pypi + permissions: + id-token: write + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v8 + with: + pattern: cibw-* + path: dist + merge-multiple: true + + # - name: Publish package distributions to TestPyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index 9838648..b354286 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,3 +65,10 @@ exclude_lines = [ [tool.pytest.ini_options] addopts = "--doctest-modules --doctest-glob=*.rst --ignore=setup.py" norecursedirs = ".git build" + +[tool.cibuildwheel] +build-verbosity = 1 +manylinux-x86_64-image = "manylinux_2_34" +manylinux-i686-image = "manylinux_2_34" +before-all = "dnf -y install systemd-devel || apt-get --update -y install libsystemd-dev" +environment-pass = ["SOURCE_DATE_EPOCH"]