mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
e5cbbf8a98
## Summary Fix several bugs in the release-only changes script that required manual fix-up commits in previous releases (e.g. #170112, #175567). - **Binary build checkout ref deleted instead of simplified**: The `sed` that removed lines matching `github.event_name == 'pull_request'` deleted the entire `ref:` line from the checkout step, causing builds to check out the default branch instead of the target SHA. Now replaces the full expression with `ref: ${{ github.sha }}`. This also removes the redundant `s#main#release/...#` on these files, which was corrupting a comment ("If doing this in main or release branch"). - **lint.yml export inserted twice**: The pattern `/generate_ci_workflows.py/` matched both the actual script invocation and an `echo` help message, inserting `export RELEASE_VERSION_TAG` in both places. Now anchored to only match the script invocation line. - **+PTX not stripped from CUDA arch lists**: Every release required a manual follow-up PR to remove `+PTX` from `.ci/manywheel/build_cuda.sh` (e.g. #175567, #157634). Now automated. - **Commit message missing `$` in variable reference**: `{RELEASE_VERSION}` → `${RELEASE_VERSION}`. - **`git push` used undefined `RELEASE_BRANCH`**: Replaced with `release/${RELEASE_VERSION}`. Authored with Claude. ## Test plan Test PR is here: https://github.com/pytorch/pytorch/pull/180466 - [x] Ran the script locally against current master (version 2.12) and verified all changes match expected release-only output - [x] Confirmed `ref: ${{ github.sha }}` present in binary build/test checkout steps (not deleted) - [x] Confirmed comment "If doing this in main or release branch" preserved - [x] Confirmed `export RELEASE_VERSION_TAG` appears exactly once in lint.yml - [x] Confirmed `+PTX` stripped from all CUDA arch entries in build_cuda.sh - [x] Confirmed zero `@main` references remain in workflow files Pull Request resolved: https://github.com/pytorch/pytorch/pull/180465 Approved by: https://github.com/malfet
PyTorch release scripts performing branch cut and applying release only changes
These are a collection of scripts that are to be used for release activities.
NOTE: All scripts should do no actual work unless the
DRY_RUNenvironment variable is set todisabled. The basic idea being that there should be no potential to do anything dangerous unlessDRY_RUNis explicitly set todisabled.
Order of Execution
- Run cut-release-branch.sh to cut the release branch
- Run apply-release-changes.sh to apply release only changes to create a PR with release only changes similar to this PR
Promoting packages
Scripts for Promotion of PyTorch packages are under test-infra repository. Please follow README.md