@@ -102,24 +102,37 @@ runs:
102102 directory : ${{ inputs.project }}
103103 project-version-substitutions : ' {"spring-cloud-dependencies-parent":"spring-cloud-build","verifier":"spring-cloud-contract","springBoot":"spring-boot"}'
104104
105+ - name : Delete CI and PR workflows from release branch
106+ shell : bash
107+ working-directory : ${{ inputs.project }}
108+ run : |
109+ for workflow in "ci.yml" "ci.yaml" "pr.yml" "pr.yaml"; do
110+ if [[ -f ".github/workflows/${workflow}" ]]; then
111+ git rm ".github/workflows/${workflow}"
112+ echo "Staged .github/workflows/${workflow} for deletion."
113+ else
114+ echo ".github/workflows/${workflow} not found — skipping."
115+ fi
116+ done
117+
105118 - name : Verify no snapshot versions
106119 uses : ./.github/actions/verify-no-snapshot-versions
107120 with :
108121 directory : ${{ inputs.project }}
109122
110- - name : Commit and push release version changes
123+ - name : Commit and push changes
111124 shell : bash
112125 working-directory : ${{ inputs.project }}
113126 run : |
114127 git config user.name "spring-builds"
115128 git config user.email "spring-builds@users.noreply.github.com"
116129 git add -A
117130 if git diff --cached --quiet; then
118- echo "No changes to commit — versions were already at release values ."
131+ echo "No changes to commit."
119132 else
120- git commit -m "Updating to release versions"
133+ git commit -m "Updating to release versions and removing CI/PR workflows "
121134 git push
122- echo "Committed and pushed release version changes."
135+ echo "Committed and pushed changes."
123136 fi
124137
125138 - name : Trigger release-train-ready workflow
@@ -143,41 +156,6 @@ runs:
143156 fi
144157 exit $watch_exit_code
145158
146- - name : Delete CI and PR workflows from release branch
147- shell : bash
148- run : |
149- repo="spring-cloud/${{ inputs.project }}"
150- branch="release/${{ inputs.project-version }}"
151- token="${{ inputs.token }}"
152-
153- git clone --depth 1 --branch "$branch" \
154- "https://x-access-token:${token}@github.com/${repo}.git" _delete_workflows
155- cd _delete_workflows
156-
157- deleted=false
158- for workflow in "ci.yml" "ci.yaml" "pr.yml" "pr.yaml"; do
159- if [[ -f ".github/workflows/${workflow}" ]]; then
160- git rm ".github/workflows/${workflow}"
161- echo "Staged .github/workflows/${workflow} for deletion."
162- deleted=true
163- else
164- echo ".github/workflows/${workflow} not found — skipping."
165- fi
166- done
167-
168- if [[ "$deleted" == "true" ]]; then
169- git config user.name "spring-builds"
170- git config user.email "spring-builds@users.noreply.github.com"
171- git commit -m "Removing CI/PR workflows - release branch is ready"
172- git push
173- echo "CI/PR workflows deleted from ${branch}."
174- else
175- echo "No CI/PR workflow files found on ${branch} — nothing to delete."
176- fi
177-
178- cd ..
179- rm -rf _delete_workflows
180-
181159 - name : Remove release branch from projects.json
182160 shell : bash
183161 env :
0 commit comments