mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-11-22 05:53:33 +00:00
Some checks failed
CI / Perform Lint Checks (3.15) (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.15 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.15 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
CI / Python 3.15 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
verify-lockfile / verify (push) Has been cancelled
GitHub introduced recently a way [to pin down dependencies using lock files](https://docs.github.com/en/actions/how-tos/secure-your-work/lock-workflow-dependencies), which also locks transitive dependencies.
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
---
|
|
name: Draft Release
|
|
|
|
# Runs when a release PR from a release/* branch (devtools/release.py prepare) is merged.
|
|
# If it fails, re-run it from the Actions tab.
|
|
on:
|
|
pull_request:
|
|
types: [closed]
|
|
branches:
|
|
- master
|
|
- patch
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
draft-release:
|
|
name: Create Draft Release
|
|
# The branch name is used to find the version as the title and labels can be edited.
|
|
if: >-
|
|
github.event.pull_request.merged
|
|
&& github.event.pull_request.head.repo.full_name == github.repository
|
|
&& startsWith(github.event.pull_request.head.ref, 'release/')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout Source Files
|
|
id: checkout
|
|
uses: actions/checkout@v6.0.2
|
|
with:
|
|
ref: ${{ github.event.pull_request.merge_commit_sha }}
|
|
persist-credentials: false
|
|
|
|
# release.py declares its dependencies inline and is run by uv.
|
|
- name: Setup uv
|
|
id: setup-uv
|
|
uses: astral-sh/setup-uv@v8.3.0
|
|
with:
|
|
version-file: uv.lock
|
|
|
|
# The draft has no tag yet, GitHub creates it at --target when the release is published.
|
|
# That in turn starts publish.yml.
|
|
- name: Create Draft Release
|
|
id: release
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
|
TARGET_SHA: ${{ github.event.pull_request.merge_commit_sha }}
|
|
run: |
|
|
version="${HEAD_REF#release/}"
|
|
if [[ ! $version =~ ^[0-9]+(\.[0-9]+){2,3}$ ]]; then
|
|
echo "::error::Invalid version: $version"
|
|
exit 1
|
|
fi
|
|
|
|
devtools/release.py extract CHANGELOG.md "$version" > notes.md
|
|
gh release create "$version" --draft --target "$TARGET_SHA" \
|
|
--title "$version" --notes-file notes.md --latest=true
|