From cdfeeac16efa049bd96125b43870a0603406638a Mon Sep 17 00:00:00 2001 From: Yuriy Liskov Date: Fri, 22 Mar 2024 02:06:06 +0200 Subject: [PATCH] add scripts --- scripts/release_cleanup.bat | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 scripts/release_cleanup.bat diff --git a/scripts/release_cleanup.bat b/scripts/release_cleanup.bat new file mode 100644 index 000000000..445c9b5ae --- /dev/null +++ b/scripts/release_cleanup.bat @@ -0,0 +1,37 @@ +@echo off + +echo Running %~n0... +echo This script removes all apks from the repo. +echo Existing tags and releases won't be touched. +echo To skip specific tags add your patterns below. +echo This could be helpful when you need to clean the repo after DMCA Notice. + +cd /d "%~dp0" + +REM Skip first 15 releases +for /F "skip=15 tokens=*" %%a in ('hub release') do call :cleanupRelease %%a + +goto End + +:cleanupRelease + set TAG_NAME=%1 + + REM Skip auto update release + if "%TAG_NAME%" == "latest" goto :cleanupReleaseEnd + + echo Processing %TAG_NAME%... + + for /F "tokens=*" %%a in ('hub release show -f %%as %TAG_NAME%') do ( + REM NOTE: don't add quotes around %%~nxf because there's a white space at the end. + REM NOTE: Empty message == don't change release title + REM Manual: https://hub.github.com/hub-release.1.html + for %%f in ("%%a") do hub release edit -a %%~nxf -m "" %TAG_NAME% 2>nul + ) + + :cleanupReleaseEnd +goto :eof + +:End + +pause +