mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-25 06:03:01 +00:00
Build and check packages in CI and publish workflows (#1782)
Some checks failed
Stale / stale (push) Has been cancelled
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Some checks failed
Stale / stale (push) Has been cancelled
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
The 0.11.0 upload failed only after the release was tagged and published, which burned the version number due to immutable releases (see #1779). - Add a local `build-packages` action that builds the packages with the release build constraints and runs `twine check --strict` on them. - Run it in the lint job, so packaging issues are caught on every PR. - Use the same action in the publish workflow.
This commit is contained in:
14
.github/actions/build-packages/action.yaml
vendored
Normal file
14
.github/actions/build-packages/action.yaml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Build Packages
|
||||||
|
description: Build the release packages into dist/ and verify their metadata
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Build Packages
|
||||||
|
id: build-packages
|
||||||
|
shell: bash
|
||||||
|
run: uv build --build-constraints .github/build-constraints.txt
|
||||||
|
|
||||||
|
- name: Check Packages
|
||||||
|
id: check-packages
|
||||||
|
shell: bash
|
||||||
|
run: uvx --with packaging==26.2 twine==7.0.0 check --strict dist/*
|
||||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -45,6 +45,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uv run pre-commit run --all-files --verbose
|
uv run pre-commit run --all-files --verbose
|
||||||
|
|
||||||
|
# Build the same way as publish.yml to catch packaging issues before a release is tagged.
|
||||||
|
- name: Build and Check Packages
|
||||||
|
id: build-packages
|
||||||
|
uses: ./.github/actions/build-packages
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}
|
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}
|
||||||
needs: lint
|
needs: lint
|
||||||
|
|||||||
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
@@ -26,11 +26,13 @@ jobs:
|
|||||||
version-file: uv.lock
|
version-file: uv.lock
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Build Packages
|
- name: Build and Check Packages
|
||||||
id: build-packages
|
id: build-packages
|
||||||
shell: bash
|
uses: ./.github/actions/build-packages
|
||||||
run: uv build --build-constraints .github/build-constraints.txt
|
|
||||||
|
|
||||||
- name: Publish Release on PyPI
|
- name: Publish Release on PyPI
|
||||||
id: publish-release-on-pypi
|
id: publish-release-on-pypi
|
||||||
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
||||||
|
with:
|
||||||
|
# Metadata is already verified by the build action, same as in CI.
|
||||||
|
verify-metadata: false
|
||||||
|
|||||||
Reference in New Issue
Block a user