Skip to content

Commit

Permalink
Update daily.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ElementalCrisis authored Oct 7, 2024
1 parent 97ac3c3 commit 33e2956
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- master
# pull_request:
# branches: [ master ]

jobs:
build:
Expand Down Expand Up @@ -42,10 +40,30 @@ jobs:
shell: pwsh
run: Compress-Archive .\\Shoko.Desktop\\bin\\Release .\\ShokoDesktop.zip

- name: Upload Daily to shokoanime.com
- name: Install PSFTP (SFTP Client)
run: |
Invoke-WebRequest -Uri "https://the.earth.li/~sgtatham/putty/latest/w64/psftp.exe" -OutFile "$env:TEMP\psftp.exe"
- 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 : .\\.github\\workflows\\UploadArchive.ps1
run: |
# Create an SFTP command script to upload the file
$sftp_script = @"
lcd $PWD
put .\\ShokoDesktop.zip /files/shoko-desktop/daily/ShokoDesktop.zip
quit
"@
# Write the script to a temporary file
$sftp_script_path = "$env:TEMP\sftp_script.txt"
$sftp_script | Out-File -FilePath $sftp_script_path
# Use PSFTP to upload the file via SFTP
& "$env:TEMP\psftp.exe" -batch -pw $env:FTP_PASSWORD $env:FTP_USERNAME@$env:FTP_SERVER -b $sftp_script_path
# Cleanup the temporary script file
Remove-Item $sftp_script_path

0 comments on commit 33e2956

Please sign in to comment.