act runner test

This commit is contained in:
RoyceDa
2026-02-17 21:34:44 +02:00
parent d928b48dbd
commit 95b0f1e056

View File

@@ -31,50 +31,13 @@ jobs:
- name: Build the application - name: Build the application
run: npm run kernel:win run: npm run kernel:win
- name: Upload build to SFTP - name: Upload to SSH
shell: powershell uses: appleboy/scp-action@master
run: | with:
# Установка модуля Posh-SSH host: ${{ secrets.SSH_HOST }}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 username: ${{ secrets.SSH_USERNAME }}
Install-PackageProvider -Scope CurrentUser -Name NuGet -MinimumVersion 2.8.5.201 -Force password: ${{ secrets.SSH_PASSWORD }}
Install-Module -Name Posh-SSH -Force -Scope CurrentUser -AllowClobber port: ${{ secrets.SSH_PORT }}
source: "dist/builds/win/x64/*.exe"
# Получаем файл для загрузки target: "${{ secrets.SSH_TARGET_DIR }}"
$file = Get-ChildItem -Path "dist/builds/win/x64/Rosetta-*.exe" | Select-Object -First 1 strip_components: 3
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!"