Skip to content

Commit 33e2956

Browse files
Update daily.yml
1 parent 97ac3c3 commit 33e2956

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/daily.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
# pull_request:
8-
# branches: [ master ]
97

108
jobs:
119
build:
@@ -42,10 +40,30 @@ jobs:
4240
shell: pwsh
4341
run: Compress-Archive .\\Shoko.Desktop\\bin\\Release .\\ShokoDesktop.zip
4442

45-
- name: Upload Daily to shokoanime.com
43+
- name: Install PSFTP (SFTP Client)
44+
run: |
45+
Invoke-WebRequest -Uri "https://the.earth.li/~sgtatham/putty/latest/w64/psftp.exe" -OutFile "$env:TEMP\psftp.exe"
46+
47+
- name: Upload Daily to shokoanime.com via SFTP
4648
shell: pwsh
4749
env:
4850
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
4951
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
5052
FTP_SERVER: ${{ secrets.FTP_SERVER }}
51-
run : .\\.github\\workflows\\UploadArchive.ps1
53+
run: |
54+
# Create an SFTP command script to upload the file
55+
$sftp_script = @"
56+
lcd $PWD
57+
put .\\ShokoDesktop.zip /files/shoko-desktop/daily/ShokoDesktop.zip
58+
quit
59+
"@
60+
61+
# Write the script to a temporary file
62+
$sftp_script_path = "$env:TEMP\sftp_script.txt"
63+
$sftp_script | Out-File -FilePath $sftp_script_path
64+
65+
# Use PSFTP to upload the file via SFTP
66+
& "$env:TEMP\psftp.exe" -batch -pw $env:FTP_PASSWORD $env:FTP_USERNAME@$env:FTP_SERVER -b $sftp_script_path
67+
68+
# Cleanup the temporary script file
69+
Remove-Item $sftp_script_path

0 commit comments

Comments
 (0)