From 95b0f1e0565bb221643b4c958c6789742be255fa Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Tue, 17 Feb 2026 21:34:44 +0200 Subject: [PATCH] act runner test --- .gitea/workflows/build.yaml | 57 +++++++------------------------------ 1 file changed, 10 insertions(+), 47 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index a289d9e..3e4fb76 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -31,50 +31,13 @@ jobs: - name: Build the application run: npm run kernel:win - - name: Upload build to SFTP - shell: powershell - run: | - # Установка модуля Posh-SSH - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - Install-PackageProvider -Scope CurrentUser -Name NuGet -MinimumVersion 2.8.5.201 -Force - Install-Module -Name Posh-SSH -Force -Scope CurrentUser -AllowClobber - - # Получаем файл для загрузки - $file = Get-ChildItem -Path "dist/builds/win/x64/Rosetta-*.exe" | Select-Object -First 1 - - if (-not $file) { - Write-Error "Build file not found in dist/builds/win/x64/" - exit 1 - } - - Write-Host "Found file: $($file.Name)" - - # Создаем credential - $securePassword = ConvertTo-SecureString "${{ secrets.SSH_PASSWORD }}" -AsPlainText -Force - $credential = New-Object System.Management.Automation.PSCredential("${{ secrets.SSH_USERNAME }}", $securePassword) - - # Подключаемся к SFTP - Write-Host "Connecting to SFTP server..." - $session = New-SFTPSession -ComputerName "${{ secrets.SSH_HOST }}" ` - -Credential $credential ` - -Port ${{ secrets.SSH_PORT }} ` - -AcceptKey - - # Удаляем старые файлы в целевой директории - Write-Host "Cleaning remote directory: ${{ secrets.SSH_TARGET_DIR }}" - $remoteFiles = Get-SFTPChildItem -SessionId $session.SessionId -Path "${{ secrets.SSH_TARGET_DIR }}" - foreach ($remoteFile in $remoteFiles) { - Remove-SFTPItem -SessionId $session.SessionId -Path $remoteFile.FullName -Force - Write-Host "Deleted: $($remoteFile.FullName)" - } - - # Загружаем новый файл - Write-Host "Uploading $($file.Name) to ${{ secrets.SSH_TARGET_DIR }}..." - Set-SFTPItem -SessionId $session.SessionId ` - -Path $file.FullName ` - -Destination "${{ secrets.SSH_TARGET_DIR }}/$($file.Name)" - - # Закрываем соединение - Remove-SFTPSession -SessionId $session.SessionId - - Write-Host "Upload completed successfully!" \ No newline at end of file + - name: Upload to SSH + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} + source: "dist/builds/win/x64/*.exe" + target: "${{ secrets.SSH_TARGET_DIR }}" + strip_components: 3 \ No newline at end of file