# Compila, prueba y publica OrganiLAB desde un PC de Windows del estudio. # # Corre en un «runner» propio de GitHub instalado en ese PC (con la etiqueta «organilab»), no en las máquinas de # GitHub: el NAS solo se alcanza desde la red del estudio, y la clave que firma las actualizaciones no sale de ese # PC. Cómo prepararlo: README, sección «Compilar y publicar en el estudio». # # Se lanza de dos formas: # - subiendo una etiqueta con las notas: git tag -a v3.8.0 -m "Lo que verán al actualizar" y git push origin v3.8.0 # - a mano, en GitHub › Actions › «Publicar OrganiLAB» › Run workflow, escribiendo las notas. name: Publicar OrganiLAB on: push: tags: ['v*'] workflow_dispatch: inputs: notas: description: 'Notas de la versión (lo que verán las copias instaladas al actualizar)' required: true permissions: contents: write concurrency: group: publicar-organilab cancel-in-progress: false jobs: publicar: runs-on: [self-hosted, windows, organilab] timeout-minutes: 120 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: La versión del código y la de la etiqueta coinciden if: startsWith(github.ref, 'refs/tags/v') shell: pwsh run: | $v = (Select-String -Path organizador.py -Pattern '^VERSION = "(.+)"').Matches[0].Groups[1].Value if ("v$v" -ne $env:GITHUB_REF_NAME) { throw "organizador.py dice $v y la etiqueta es $env:GITHUB_REF_NAME" } - name: Pruebas shell: pwsh run: | py -3.12 probar.py; if ($LASTEXITCODE) { exit 1 } py -3.12 prueba_orden.py; if ($LASTEXITCODE) { exit 1 } py -3.12 prueba_funcional.py; if ($LASTEXITCODE) { exit 1 } - name: labstream-os, al lado (el manifiesto se publica desde ahí) shell: pwsh run: | if (-not (Test-Path ..\labstream-os)) { git clone https://github.com/Labstream2026/labstream-os.git ..\labstream-os } git -C ..\labstream-os fetch -q origin main - name: Empaquetar shell: pwsh env: NOTAS_A_MANO: ${{ inputs.notas }} run: | $n = $env:NOTAS_A_MANO if (-not $n) { $n = (git tag -l --format='%(contents)' $env:GITHUB_REF_NAME) -join "`n" } if (-not $n -or -not $n.Trim()) { throw "Faltan las notas: pon un mensaje en la etiqueta (git tag -a vX.Y.Z -m '...')" } $env:NOTAS = $n.Trim() py -3.12 empaquetar.py; if ($LASTEXITCODE) { exit 1 } - name: Probar el paquete como lo instalaría alguien shell: pwsh run: py -3.12 prueba_ventana.py --paquete dist\OrganizadorLabstream; if ($LASTEXITCODE) { exit 1 } - name: Publicar (NAS y manifiesto) shell: bash run: bash publicar.sh - name: Comprobar lo publicado shell: pwsh run: py -3.12 verificar_publicado.py; if ($LASTEXITCODE) { exit 1 } - name: Guardar el manifiesto en el repositorio shell: pwsh run: | git -C ..\labstream-os checkout -- public/herramientas/organizador.json $v = (Select-String -Path organizador.py -Pattern '^VERSION = "(.+)"').Matches[0].Groups[1].Value Copy-Item manifiesto.json $env:RUNNER_TEMP\manifiesto.json git fetch -q origin main git checkout -q -B main origin/main Copy-Item $env:RUNNER_TEMP\manifiesto.json manifiesto.json git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add manifiesto.json git diff --cached --quiet; if ($LASTEXITCODE) { git commit -q -m "Manifiesto de la $v publicada"; git push -q origin main }