@@ -128,6 +128,7 @@ jobs:
128128 set -euo pipefail
129129 VERSION="${{ steps.version.outputs.version }}"
130130 TAG="${{ steps.version.outputs.tag }}"
131+ PRERELEASE="${{ steps.version.outputs.prerelease }}"
131132 UPM_TAG="upm/$VERSION"
132133
133134 if git ls-remote --exit-code --tags origin "$UPM_TAG" >/dev/null 2>&1; then
@@ -141,20 +142,26 @@ jobs:
141142 trap 'rm -f "$UPM_INDEX"' EXIT
142143 export GIT_INDEX_FILE="$UPM_INDEX"
143144 git read-tree "$TAG"
144- git rm -r --cached --quiet --ignore-unmatch .github CLAUDE.md CLAUDE.md.meta
145+ git rm -r --cached --quiet --ignore-unmatch .github CLAUDE.md CLAUDE.md.meta .gitignore .gitignore.meta
145146 TREE=$(git write-tree)
146147 unset GIT_INDEX_FILE
147148 PARENT=$(git rev-parse "$TAG^{commit}")
148149 COMMIT=$(git commit-tree "$TREE" -p "$PARENT" -m "UPM release $VERSION")
149150
150- # Move the upm branch forward to this release's commit.
151- git push --force origin "$COMMIT:refs/heads/upm"
151+ # Move the appropriate upm branch forward:
152+ # pre-releases → upm-preview, stable releases → upm.
153+ if [[ "$PRERELEASE" == "true" ]]; then
154+ UPM_BRANCH="upm-preview"
155+ else
156+ UPM_BRANCH="upm"
157+ fi
158+ git push --force origin "$COMMIT:refs/heads/$UPM_BRANCH"
152159
153160 # Immutable per-version tag for users who pin to a specific release.
154161 git tag "$UPM_TAG" "$COMMIT"
155162 git push origin "$UPM_TAG"
156163
157- echo "Published $UPM_TAG and updated upm branch."
164+ echo "Published $UPM_TAG and updated $UPM_BRANCH branch."
158165
159166 - name : Create GitHub release
160167 uses : softprops/action-gh-release@v2
0 commit comments