Skip to content

Update daily.yml

Update daily.yml #118

Workflow file for this run

name: Build Daily
on:
push:
branches:
- master
jobs:
build:
runs-on: windows-latest
name: Shoko Desktop daily build
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: Setup MSBuild Path
uses: warrenbuckley/Setup-MSBuild@v1
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore NuGet Packages
run: nuget restore Shoko.Desktop.sln
- name: Build
run: msbuild Shoko.Desktop.sln /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=FolderProfile
- name: Upload Artifact
uses: actions/[email protected]
with:
name: ShokoDesktop
path: Shoko.Desktop\bin\Release
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Desktop\\bin\\Release .\\ShokoDesktop.zip
- name: Upload Daily to shokoanime.com via SFTP
shell: pwsh
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run: |
# Create the SFTP command script as a string
$sftpCommands = @"
put .\\ShokoDesktop.zip /files/shoko-desktop/daily/ShokoDesktop.zip
bye
"@
# Write the commands to a temporary file
$sftpScriptPath = "$env:TEMP\\sftp_commands.txt"
$sftpCommands | Out-File -FilePath $sftpScriptPath -Encoding ASCII
# Execute the SFTP command with the temporary script
sftp -o StrictHostKeyChecking=no -b $sftpScriptPath $env:FTP_USERNAME@$env:FTP_SERVER