- [NEW] Scripts de publicació
This commit is contained in:
20
do_release.bat
Normal file
20
do_release.bat
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
REM Comprobar parámetro
|
||||||
|
IF "%1"=="" (
|
||||||
|
echo Uso: build_windows.bat ^<PARAMETRO^>
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set PARAM=%1
|
||||||
|
|
||||||
|
echo Compilando windows...
|
||||||
|
g++ main.cpp -O3 -o lagueirto.exe || exit /b 1
|
||||||
|
|
||||||
|
echo Creando paquetes...
|
||||||
|
|
||||||
|
REM Crear ZIP release con mini.exe + DLLs
|
||||||
|
tar -a -c -f lagueirto_%PARAM%_win32-x64.zip lagueirto.exe || exit /b 1
|
||||||
|
|
||||||
|
echo Paquetes generados:
|
||||||
|
echo lagueirto_%PARAM%_win32-x64.zip
|
||||||
36
do_release.sh
Normal file
36
do_release.sh
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#if [ -z "$1" ]; then
|
||||||
|
# echo "Uso: $0 <PARAMETRO>"
|
||||||
|
# exit 1
|
||||||
|
#fi
|
||||||
|
|
||||||
|
# Leer versión desde version.h
|
||||||
|
VERSION=$(grep '#define LAGUEIRTO_VERSION' version.h | sed 's/.*"\(.*\)".*/\1/')
|
||||||
|
echo "Versión detectada: $VERSION"
|
||||||
|
|
||||||
|
#PARAM=$1
|
||||||
|
|
||||||
|
# Datos Windows
|
||||||
|
WIN_USER="raimon"
|
||||||
|
WIN_HOST="192.168.1.53"
|
||||||
|
WIN_PATH_SSH="C:\Users\raimon\dev\lagueirto"
|
||||||
|
WIN_PATH_SCP="C:/Users/Raimon/dev/lagueirto"
|
||||||
|
|
||||||
|
echo "=== Compilando Linux ==="
|
||||||
|
g++ main.cpp -O3 -o lagueirto
|
||||||
|
|
||||||
|
echo "=== Empaquetando Linux ==="
|
||||||
|
tar -czf lagueirto_v${VERSION}_linux.tar.gz lagueirto
|
||||||
|
|
||||||
|
echo "=== Ejecutando build remoto Windows ==="
|
||||||
|
ssh ${WIN_USER}@${WIN_HOST} "cd ${WIN_PATH_SSH} && do_release.bat v${VERSION}"
|
||||||
|
|
||||||
|
echo "=== Copiando ZIPs desde Windows ==="
|
||||||
|
scp ${WIN_USER}@${WIN_HOST}:"${WIN_PATH_SCP}/lagueirto_v${VERSION}_win32-x64.zip" .
|
||||||
|
|
||||||
|
echo "=== Build completado correctamente ==="
|
||||||
|
echo "Generados:"
|
||||||
|
echo " lagueirto_v${VERSION}_linux.tar.gz"
|
||||||
|
echo " lagueirto_v${VERSION}_win32-x64.zip"
|
||||||
4
main.cpp
4
main.cpp
@@ -8,7 +8,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define VERSION "2.0.1"
|
#include "version.h"
|
||||||
|
|
||||||
std::string libs = "";
|
std::string libs = "";
|
||||||
std::string cppflags = "";
|
std::string cppflags = "";
|
||||||
@@ -430,7 +430,7 @@ void processCommand(std::string arg) {
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
std::cout << "Lagueirto v" << VERSION << std::endl;
|
std::cout << "Lagueirto v" << LAGUEIRTO_VERSION << std::endl;
|
||||||
|
|
||||||
std::string configuration_to_use;
|
std::string configuration_to_use;
|
||||||
for (int i = 1; i < argc; ++i)
|
for (int i = 1; i < argc; ++i)
|
||||||
|
|||||||
55
publish_gitea.sh
Normal file
55
publish_gitea.sh
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#if [ -z "$1" ]; then
|
||||||
|
# echo "Uso: $0 <PARAMETRO>"
|
||||||
|
# exit 1
|
||||||
|
#fi
|
||||||
|
|
||||||
|
GITEA_TOKEN="eb44d9c0142f5038c61c5afd17f5a41177bfaedc"
|
||||||
|
|
||||||
|
if [ -z "$GITEA_TOKEN" ]; then
|
||||||
|
echo "ERROR: Debes exportar GITEA_TOKEN"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Leer versión desde version.h
|
||||||
|
VERSION=$(grep '#define LAGUEIRTO_VERSION' version.h | sed 's/.*"\(.*\)".*/\1/')
|
||||||
|
echo "Versión detectada: $VERSION"
|
||||||
|
|
||||||
|
#PARAM=$1
|
||||||
|
API="https://gitea.sustancia.synology.me/api/v1"
|
||||||
|
REPO="JailDoctor/lagueirto"
|
||||||
|
|
||||||
|
echo "=== Creando release ${VERSION} en Gitea ==="
|
||||||
|
|
||||||
|
RELEASE_ID=$(curl -s -X POST "${API}/repos/${REPO}/releases" \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"${VERSION}\",
|
||||||
|
\"name\": \"Release ${VERSION}\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}" | jq -r '.id')
|
||||||
|
|
||||||
|
if [ "$RELEASE_ID" = "null" ]; then
|
||||||
|
echo "ERROR: No se pudo crear el release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Release creado con ID: $RELEASE_ID"
|
||||||
|
|
||||||
|
echo "=== Subiendo artefactos ==="
|
||||||
|
|
||||||
|
for f in lagueirto_v${VERSION}_linux.tar.gz \
|
||||||
|
lagueirto_v${VERSION}_win32-x64.zip \
|
||||||
|
do
|
||||||
|
echo "Subiendo $f..."
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-F "attachment=@${f}" \
|
||||||
|
"${API}/repos/${REPO}/releases/${RELEASE_ID}/assets" > /dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "=== Publicación completada ==="
|
||||||
Reference in New Issue
Block a user