Update daily.yml #117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 (OpenSSH) | |
shell: pwsh | |
env: | |
FTP_USERNAME: ${{ secrets.FTP_USERNAME }} | |
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | |
FTP_SERVER: ${{ secrets.FTP_SERVER }} | |
run: | | |
# Create an SSH pass file to provide the password | |
$password = ConvertTo-SecureString -AsPlainText $env:FTP_PASSWORD -Force | |
$credential = New-Object System.Management.Automation.PSCredential ($env:FTP_USERNAME, $password) | |
# Disable host key checking and upload using OpenSSH's SFTP client | |
sftp -o StrictHostKeyChecking=no $env:FTP_USERNAME@$env:FTP_SERVER <<EOF | |
put .\\ShokoDesktop.zip /files/shoko-desktop/daily/ShokoDesktop.zip | |
bye | |
EOF |