Files
wehub-resource-sync 59a0a3844c
PR Test AMD / cancel-on-close (push) Has been skipped
PR Test NVIDIA ARM / scan (push) Has been skipped
PR Test NVIDIA / cancel-on-close (push) Has been skipped
PR Test AMD / scan (push) Has been skipped
PR Test NVIDIA ARM / cancel-on-close (push) Has been skipped
PR Test NVIDIA / scan (push) Has been skipped
Release Docker Images / build (cu129-torch-2.11.0) (push) Has been skipped
Release Docker Images / build (cu130-torch-2.11.0) (push) Has been skipped
Release PyPI / publish (push) Has been skipped
Scheduler Python Test / test (push) Successful in 27m19s
Docs / build (push) Successful in 28m8s
Scheduler C++ Test / test (push) Successful in 28m19s
Scheduler C++ Test / test-flat (push) Successful in 28m18s
Docs / deploy (push) Has been cancelled
PR Test AMD / finish (push) Has been cancelled
PR Test NVIDIA / finish (push) Has been cancelled
PR Test NVIDIA ARM / finish (push) Has been cancelled
PR Test NVIDIA ARM / ${{ matrix.name }} (${{ matrix.runner }}) (push) Has been cancelled
PR Test AMD / ${{ matrix.name }} (${{ matrix.runner }}) (push) Has been cancelled
PR Test NVIDIA / ${{ matrix.name }} (${{ matrix.runner }}) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:31 +08:00

107 lines
3.3 KiB
YAML

name: Update tokenspeed-kernel MLA
on:
workflow_dispatch:
inputs:
mla_version:
description: "tokenspeed-mla version to use, for example 0.1.2 or v0.1.2."
required: true
type: string
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ inputs.mla_version }}
cancel-in-progress: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
- name: Configure git author
run: |
git config user.name "lightseek-bot"
git config user.email "243258330+lightseek-bot@users.noreply.github.com"
- name: Update tokenspeed-mla dependency
id: update
run: |
raw_version="${{ inputs.mla_version }}"
version="${raw_version#v}"
if ! [[ "$version" =~ ^[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]+)?(\.post[0-9]+)?(\.dev[0-9]+)?(\+[A-Za-z0-9.]+)?$ ]]; then
echo "Invalid tokenspeed-mla version: $raw_version" >&2
exit 1
fi
python - "$version" <<'PY'
import re
import sys
from pathlib import Path
version = sys.argv[1]
path = Path("tokenspeed-kernel/python/requirements/cuda-thirdparty.txt")
text = path.read_text()
text, count = re.subn(
r"(?m)^tokenspeed-mla==[^\n]+$",
f"tokenspeed-mla=={version}",
text,
count=1,
)
if count != 1:
raise SystemExit("tokenspeed-mla dependency not found")
path.write_text(text)
PY
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Create pull request
env:
GH_TOKEN: ${{ secrets.LIGHTSEEK_BOT_TOKEN }}
VERSION: ${{ steps.update.outputs.version }}
run: |
if [ -z "$GH_TOKEN" ]; then
echo "LIGHTSEEK_BOT_TOKEN is required because this repository does not allow GITHUB_TOKEN to create pull requests." >&2
exit 1
fi
if git diff --quiet; then
echo "tokenspeed-kernel already uses tokenspeed-mla $VERSION."
exit 0
fi
branch="bot/update-tokenspeed-kernel-mla-${VERSION//+/-}"
git checkout -b "$branch"
git add tokenspeed-kernel/python/requirements/cuda-thirdparty.txt
git commit -s -m "Update tokenspeed-kernel MLA to ${VERSION}"
git push --force origin "HEAD:refs/heads/${branch}"
cat > pr-body.md <<EOF
## Summary
- update tokenspeed-kernel tokenspeed-mla dependency to ${VERSION}
## Tests
- Not run (dependency-only workflow update)
EOF
if gh pr view "$branch" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh pr edit "$branch" \
--repo "$GITHUB_REPOSITORY" \
--title "Update tokenspeed-kernel MLA to ${VERSION}" \
--body-file pr-body.md
else
gh pr create \
--repo "$GITHUB_REPOSITORY" \
--base main \
--head "$branch" \
--title "Update tokenspeed-kernel MLA to ${VERSION}" \
--body-file pr-body.md
fi