DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
ci: allow resuming a partial PyPI release
Bingxi Zhao (Frank)78ffdc047898
diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.ymlindex 30ce51470..1be3bd165 100644--- a/.github/workflows/pypi-release.yml+++ b/.github/workflows/pypi-release.yml@@ -14,19 +14,32 @@ name: PyPI Releaseon:release:types: [published]+ workflow_dispatch:+ inputs:+ tag:+ description: Existing release tag to publish+ required: true+ type: string+ resume:+ description: Skip files already uploaded by a partial release+ default: false+ type: boolean++env:+ RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }}permissions:contents: readid-token: writeconcurrency:- group: pypi-release-${{ github.event.release.tag_name }}+ group: pypi-release-${{ inputs.tag || github.event.release.tag_name }}cancel-in-progress: falsejobs:validate-release-tag:name: Validate release tag- if: startsWith(github.event.release.tag_name, 'v')+ if: startsWith(inputs.tag || github.event.release.tag_name, 'v')runs-on: ubuntu-lateststeps:- name: Require a package version tag@@ -48,8 +61,6 @@ jobs:f"Release tag {tag!r} is not a package version tag ""(expected vX.Y.Z with an optional suffix).")- env:- RELEASE_TAG: ${{ github.event.release.tag_name }}build-and-publish:name: Build and Publish PyPI Package@@ -63,7 +74,7 @@ jobs:- name: Checkout release taguses: actions/checkout@v4with:- ref: ${{ github.event.release.tag_name }}+ ref: ${{ inputs.tag || github.event.release.tag_name }}fetch-depth: 0- name: Verify release tag is on main@@ -71,7 +82,7 @@ jobs:run: |set -euo pipefailgit fetch origin main:refs/remotes/origin/main --no-tags- tag="${{ github.event.release.tag_name }}"+ tag="$RELEASE_TAG"tag_commit="$(git rev-list -n 1 "$tag")"if ! git merge-base --is-ancestor "$tag_commit" origin/main; thenecho "Release tag $tag ($tag_commit) is not on origin/main; refusing to publish to PyPI." >&2@@ -128,8 +139,6 @@ jobs:with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as handle:handle.write(f"version={code_version}\n")PY- env:- RELEASE_TAG: ${{ github.event.release.tag_name }}- name: Install frontend dependenciesworking-directory: web@@ -173,3 +182,4 @@ jobs:with:packages-dir: dist/deeptutor/print-hash: true+ skip-existing: ${{ inputs.resume || false }}diff --git a/tests/test_release_workflow_guards.py b/tests/test_release_workflow_guards.pyindex 740e3558b..47b7c8e04 100644--- a/tests/test_release_workflow_guards.py+++ b/tests/test_release_workflow_guards.py@@ -55,7 +55,12 @@ def test_non_version_release_tags_skip_publication(publication: str) -> None:document, publish_job_name = _workflow(publication)validator = document["jobs"]["validate-release-tag"]- assert validator["if"] == "startsWith(github.event.release.tag_name, 'v')"+ tag_expression = (+ "inputs.tag || github.event.release.tag_name"+ if publication == "pypi"+ else "github.event.release.tag_name"+ )+ assert validator["if"] == f"startsWith({tag_expression}, 'v')"assert document["jobs"][publish_job_name]["needs"] == "validate-release-tag"