diff --git a/B4A/B4XMainPage.bas b/B4A/B4XMainPage.bas index be9473b..1a443ec 100644 --- a/B4A/B4XMainPage.bas +++ b/B4A/B4XMainPage.bas @@ -18,6 +18,7 @@ Version=9.85 '###################### PUSH TORTOISE GIT ######################################################### 'Ctrl + click ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=TortoiseGitProc&Args=/command:commit&Args=/path:"./../../"&Args=/closeonend:2 '########################################################################################################### + 'Ctrl + clic para enviar Version: ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=-ExecutionPolicy&Args=Bypass&Args=-File&Args=%PROJECT%\git_tag.ps1&Args=%PROJECT%&Args=%PROJECT_NAME% #End Region 'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\ diff --git a/B4A/KelloggsV4.b4a b/B4A/KelloggsV4.b4a index 91f72c4..14a2193 100644 --- a/B4A/KelloggsV4.b4a +++ b/B4A/KelloggsV4.b4a @@ -917,7 +917,7 @@ Version=12.8 #Region Project Attributes #ApplicationLabel: Kelloggs Venta #VersionCode: 3000 - #VersionName: 5.12.15 + #VersionName: 5.12.15.test #SupportedOrientations: portrait #CanInstallToExternalStorage: False #BridgeLogger:true diff --git a/B4A/KelloggsV4.b4a.meta b/B4A/KelloggsV4.b4a.meta index 05523f5..2de2bbc 100644 --- a/B4A/KelloggsV4.b4a.meta +++ b/B4A/KelloggsV4.b4a.meta @@ -100,6 +100,6 @@ ModuleClosedNodes6= ModuleClosedNodes7= ModuleClosedNodes8= ModuleClosedNodes9= -NavigationStack=C_Cliente,B4XPage_Appear,841,0,B4XMainPage,Class_Globals,118,0,B4XMainPage,Initialize,126,0,C_Principal,cargar_Click,1031,0,Subs,modTrendSpending,2210,3,C_TrendSpending,modTrendSpending,112,2,C_Productos,B4XPage_Appear,236,0,C_TrendSpending,traeDescXSku,59,0,C_TrendSpending,traeInfoTrendSpending,73,2,C_Principal,JobDone,2240,0 +NavigationStack=C_Cliente,B4XPage_Appear,841,0,B4XMainPage,Class_Globals,118,0,C_Principal,cargar_Click,1031,0,Subs,modTrendSpending,2210,3,C_TrendSpending,modTrendSpending,112,2,C_Productos,B4XPage_Appear,236,0,C_TrendSpending,traeDescXSku,59,0,C_TrendSpending,traeInfoTrendSpending,73,2,C_Principal,JobDone,2240,0,B4XMainPage,Initialize,126,0,Main,Activity_Create,43,0 SelectedBuild=0 VisibleModules=31,1,12,3,32,13,14,20,19,33,16 diff --git a/B4A/git_tag.ps1 b/B4A/git_tag.ps1 new file mode 100644 index 0000000..b6863e6 --- /dev/null +++ b/B4A/git_tag.ps1 @@ -0,0 +1,42 @@ +# Argumentos recibidos desde B4A +param([string]$projectPath, [string]$projectName) + +# 1. Leer el archivo .b4a para buscar el #VersionName +$b4aFile = Join-Path $projectPath "$projectName.b4a" +if (-Not (Test-Path $b4aFile)) { + Write-Error "No se pudo encontrar el archivo del proyecto: $b4aFile" + return +} + +$versionLine = Get-Content $b4aFile | Select-String "#VersionName:" + +if ($versionLine) { + # Extraer el valor numérico de la versión + $version = ($versionLine -split ":")[1].Trim() + $tagName = "v$version" + + # 2. Abrir TortoiseGit para el Commit + # Usamos /closeonend:1 para que se cierre si el commit es exitoso + Write-Host "Iniciando Commit para la version $version..." + $process = Start-Process "TortoiseGitProc.exe" -ArgumentList "/command:commit", "/path:`"$projectPath`"", "/logmsg:`"Version $version`"", "/closeonend:1" -Wait -PassThru + + # 3. Verificar si el commit se realizó (si el usuario no canceló) + if ($process.ExitCode -eq 0) { + Set-Location $projectPath + + # 4. Crear el Tag localmente + Write-Host "Creando etiqueta $tagName..." + git tag -a $tagName -m "Release version $version" + + # 5. Hacer el PUSH de la rama y de los TAGS a GitHub + Write-Host "Subiendo cambios y etiquetas a GitHub..." + # Esto sube el código y específicamente todos los tags nuevos + git push origin --follow-tags + + Write-Host "¡Proceso completado! Version $version enviada con Tag." + } else { + Write-Warning "El proceso de commit fue cancelado o falló." + } +} else { + Write-Error "No se encontró el atributo #VersionName en el código." +} \ No newline at end of file