@@ -155,7 +155,7 @@ jobs:
155155 - name : Install SVN
156156 run : sudo apt-get update && sudo apt-get install -y subversion
157157
158- - name : Deploy to WordPress.org SVN (shallow)
158+ - name : Deploy trunk to WordPress.org SVN
159159 env :
160160 SVN_USERNAME : ${{ secrets.SVN_USERNAME }}
161161 SVN_PASSWORD : ${{ secrets.SVN_PASSWORD }}
@@ -167,53 +167,64 @@ jobs:
167167 SVN_URL="https://plugins.svn.wordpress.org/${SLUG}"
168168 SVN_DIR="${HOME}/svn-${SLUG}"
169169
170- # Shallow checkout: only trunk and assets (no tags history)
170+ # Step 1: Shallow checkout — only trunk (no tags, no history)
171171 svn checkout --depth=immediates "${SVN_URL}" "${SVN_DIR}"
172172 svn update --set-depth=infinity "${SVN_DIR}/trunk"
173- svn update --set-depth=immediates "${SVN_DIR}/tags"
174173
175- # If assets dir exists in SVN, pull it too
176- if svn info "${SVN_URL}/assets" > /dev/null 2>&1; then
177- svn update --set-depth=infinity "${SVN_DIR}/assets"
178- fi
179-
180- # Sync build artifact into trunk (the unzipped plugin files are in ./ultimate-multisite/)
174+ # Sync build artifact into trunk
181175 rsync -rc --delete ./ultimate-multisite/ "${SVN_DIR}/trunk/" \
182176 --exclude='.svn' --exclude='.git' --exclude='.github'
183177
184- # Create the new tag from trunk
185- if svn info "${SVN_URL}/tags/${VERSION}" > /dev/null 2>&1; then
186- echo "Tag ${VERSION} already exists in SVN — skipping tag creation"
187- else
188- svn copy "${SVN_DIR}/trunk" "${SVN_DIR}/tags/${VERSION}"
189- fi
190-
191- # Copy readme.txt to trunk for wp.org metadata
178+ # Ensure readme.txt is in trunk for wp.org metadata
192179 cp readme.txt "${SVN_DIR}/trunk/readme.txt"
193180
194- # Stage all changes
181+ # Stage changes in trunk only
195182 cd "${SVN_DIR}"
196- svn add --force . --auto-props --parents --depth infinity -q 2>/dev/null || true
197- # Remove deleted files from SVN tracking
198- svn status | grep '^\!' | awk '{print $2}' | xargs -r svn delete --force -q
183+ svn add --force trunk --auto-props --parents --depth infinity -q 2>/dev/null || true
184+ svn status trunk | grep '^\!' | awk '{print $2}' | xargs -r svn delete --force -q
199185
200- # Show what will be committed
201- echo "=== SVN Status ==="
202- svn status | head -50
203- CHANGES=$(svn status | wc -l)
204- echo "Total changes: ${CHANGES}"
186+ echo "=== SVN Status (trunk) ==="
187+ svn status trunk | head -50
188+ CHANGES=$(svn status trunk | wc -l)
189+ echo "Total trunk changes: ${CHANGES}"
205190
206191 if [ "${CHANGES}" -eq 0 ]; then
207- echo "No changes to commit to WordPress.org SVN"
192+ echo "No changes to commit to trunk"
193+ else
194+ svn commit \
195+ --username "${SVN_USERNAME}" \
196+ --password "${SVN_PASSWORD}" \
197+ --no-auth-cache \
198+ --non-interactive \
199+ -m "Update trunk to ${VERSION}"
200+ echo "Trunk committed successfully"
201+ fi
202+
203+ - name : Tag release on WordPress.org SVN (server-side copy)
204+ env :
205+ SVN_USERNAME : ${{ secrets.SVN_USERNAME }}
206+ SVN_PASSWORD : ${{ secrets.SVN_PASSWORD }}
207+ SLUG : ultimate-multisite
208+ VERSION : ${{ env.VERSION }}
209+ run : |
210+ set -euo pipefail
211+
212+ SVN_URL="https://plugins.svn.wordpress.org/${SLUG}"
213+
214+ # Check if tag already exists
215+ if svn info "${SVN_URL}/tags/${VERSION}" > /dev/null 2>&1; then
216+ echo "Tag ${VERSION} already exists in SVN — skipping"
208217 exit 0
209218 fi
210219
211- # Commit with timeout-friendly settings
212- svn commit \
220+ # Server-side copy: no download/upload, runs entirely on wp.org SVN server
221+ svn copy \
222+ "${SVN_URL}/trunk" \
223+ "${SVN_URL}/tags/${VERSION}" \
213224 --username "${SVN_USERNAME}" \
214225 --password "${SVN_PASSWORD}" \
215226 --no-auth-cache \
216227 --non-interactive \
217- -m "Release ${VERSION}"
228+ -m "Tag ${VERSION}"
218229
219- echo "Successfully deployed ${VERSION} to WordPress.org"
230+ echo "Successfully tagged ${VERSION} on WordPress.org"
0 commit comments