Files
pytorch/scripts/release
Andrey Talman e5cbbf8a98 [releng] Fix few issues in apply-release-changes.sh (#180465)
## 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
2026-04-15 18:28:22 +00:00
..

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_RUN environment variable is set to disabled. The basic idea being that there should be no potential to do anything dangerous unless DRY_RUN is explicitly set to disabled.

Order of Execution

  1. Run cut-release-branch.sh to cut the release branch
  2. 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