stages: - build - release variables: GIT_DEPTH: 0 GH_TOKEN: $GITHUB_TOKEN .install_dependencies: before_script: - python3 -V - pip3 -V - pip3 install --upgrade pip - pip3 install -r lib/requirements.txt - apt-get update && apt-get install -y curl - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null - apt-get update && apt-get install -y gh - gh auth setup-git .install_windows_dependencies: before_script: - python -V - pip -V - pip install --upgrade pip - pip install -r lib/requirements.txt - choco install gh cli --confirm - gh auth setup-git build_linux: stage: build image: python:3.9-slim-buster extends: .install_dependencies script: - echo "Iniciando compilación para Linux..." - cd packagemaker - python3 packagemaker.py --buildthis - ls -R releases artifacts: paths: - packagemaker/releases/*.iflapp expire_in: 1 week only: - main build_windows: stage: build tags: - windows extends: .install_windows_dependencies script: - echo "Iniciando compilación para Windows..." - choco install gh cli --confirm - gh auth setup-git - cd packagemaker - python packagemaker.py --buildthis - ls -R releases artifacts: paths: - packagemaker/releases/*.iflapp expire_in: 1 week only: - main release_job: stage: release image: python:3.9-slim-buster extends: .install_dependencies script: - echo "Extrayendo versión de details.xml..." - python3 -c "import xml.etree.ElementTree as ET; tree = ET.parse('packagemaker/details.xml'); version = tree.getroot().find('version').text; print(version)" > VERSION_TAG.txt - VERSION=$(cat VERSION_TAG.txt) - echo "Versión detectada $VERSION" - | if gh release view $VERSION &>/dev/null; then echo "Release $VERSION existe. Eliminando..." gh release delete $VERSION --yes else echo "Release $VERSION no existe." fi - gh release create $VERSION --notes "" --draft - | for file in packagemaker/releases/*.iflapp; do if [ -f "$file" ]; then echo "Subiendo $file al release $VERSION..." gh release upload $VERSION "$file" else echo "Advertencia: No se encontró el archivo $file" fi done - | if [ -f "packagemaker/RELEASE_NOTES.md" ]; then gh release edit $VERSION --notes-file packagemaker/RELEASE_NOTES.md else echo "Advertencia: No se encontró RELEASE_NOTES.md. El release se creará sin notas." fi - gh release edit $VERSION --draft=false - echo "Workflow de Release completado." dependencies: - build_linux - build_windows allow_failure: true only: - main