From f4cd0d42047e128f821c501fc4a1800ef05ca364 Mon Sep 17 00:00:00 2001 From: damacenox Date: Tue, 24 Dec 2024 20:39:41 -0300 Subject: [PATCH 1/2] Update main.yml --- .github/workflows/main.yml | 67 +++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20f6922..20d7719 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,30 +1,51 @@ -# This is a basic workflow to help you get started with Actions +name: Windows Cloud PC - Anydesk (Optimized) -name: Build CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: - push: - branches: [master] - pull_request: - branches: [master] + workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - env: - BIT_TOKEN: ${{ secrets.BIT_TOKEN }} - # Steps represent a sequence of tasks that will be executed as part of the job + name: Start Building... + runs-on: windows-latest + timeout-minutes: 10080 # Máximo de 7 dias para evitar tempo de execução excessivo + steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - name: Downloading & Installing Essentials + run: | + # Baixa o arquivo .bat para instalar componentes essenciais + Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/7eiczvgil84czu55dxep3/Downloads.bat?rlkey=wzdc1wxjsph2b7r0atplmdz3p&dl=1" -OutFile "Downloads.bat" + # Executa o script .bat para instalar os componentes + cmd /c Downloads.bat + + - name: Log In To AnyDesk + run: | + # Verifica se o arquivo start.bat existe antes de executar + if (Test-Path "start.bat") { + cmd /c start.bat + } else { + Write-Host "Arquivo start.bat não encontrado. Verifique a configuração." + } + + - name: Monitor and Restart AnyDesk if Needed + run: | + # Monitora a conexão do AnyDesk e reinicia se necessário + while ($true) { + $process = Get-Process -Name "AnyDesk" -ErrorAction SilentlyContinue + if (-not $process) { + Write-Host "AnyDesk não está rodando, reiniciando..." + cmd /c start.bat + } + Start-Sleep -Seconds 300 # Verifica a cada 5 minutos + } + + - name: Time Counter (Long Running Task) + run: | + # Configura para manter a máquina em execução + Start-Sleep -Seconds 604800 # 7 dias de execução contínua - # Install dependencies and build app - - name: Install Dependencies - run: npm install - - name: Build app - run: npm run build + - name: Clean Up Temporary Files + if: success() # Executa esta etapa apenas se todas as etapas anteriores forem bem-sucedidas + run: | + # Remove arquivos temporários ou logs gerados + Remove-Item Downloads.bat -Force + Write-Host "Limpeza completa." From 062e22a460123c3bc2a11268173ef78579191ce6 Mon Sep 17 00:00:00 2001 From: damacenox Date: Tue, 24 Dec 2024 20:49:42 -0300 Subject: [PATCH 2/2] Delete .github/workflows/main.yml --- .github/workflows/main.yml | 51 -------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 20d7719..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Windows Cloud PC - Anydesk (Optimized) - -on: - workflow_dispatch: - -jobs: - build: - name: Start Building... - runs-on: windows-latest - timeout-minutes: 10080 # Máximo de 7 dias para evitar tempo de execução excessivo - - steps: - - name: Downloading & Installing Essentials - run: | - # Baixa o arquivo .bat para instalar componentes essenciais - Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/7eiczvgil84czu55dxep3/Downloads.bat?rlkey=wzdc1wxjsph2b7r0atplmdz3p&dl=1" -OutFile "Downloads.bat" - # Executa o script .bat para instalar os componentes - cmd /c Downloads.bat - - - name: Log In To AnyDesk - run: | - # Verifica se o arquivo start.bat existe antes de executar - if (Test-Path "start.bat") { - cmd /c start.bat - } else { - Write-Host "Arquivo start.bat não encontrado. Verifique a configuração." - } - - - name: Monitor and Restart AnyDesk if Needed - run: | - # Monitora a conexão do AnyDesk e reinicia se necessário - while ($true) { - $process = Get-Process -Name "AnyDesk" -ErrorAction SilentlyContinue - if (-not $process) { - Write-Host "AnyDesk não está rodando, reiniciando..." - cmd /c start.bat - } - Start-Sleep -Seconds 300 # Verifica a cada 5 minutos - } - - - name: Time Counter (Long Running Task) - run: | - # Configura para manter a máquina em execução - Start-Sleep -Seconds 604800 # 7 dias de execução contínua - - - name: Clean Up Temporary Files - if: success() # Executa esta etapa apenas se todas as etapas anteriores forem bem-sucedidas - run: | - # Remove arquivos temporários ou logs gerados - Remove-Item Downloads.bat -Force - Write-Host "Limpeza completa."