File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 5656 run : |
5757 .\Packaging\Build.ps1 -Mode Canary
5858
59+ - name : Upload to Alist
60+ shell : powershell
61+ env :
62+ ALIST_TOKEN : ${{ secrets.ALIST_TOKEN }}
63+ run : |
64+ $alistUrl = "https://alist.c5y.moe"
65+
66+ # 找到构建产物
67+ $appxFile = Get-ChildItem -Path "Packaging" -Filter "MaiChartManager_Canary_*.appx" | Select-Object -First 1
68+ if (-not $appxFile) {
69+ throw "No appx file found!"
70+ }
71+
72+ Write-Host "Uploading $($appxFile.Name)..."
73+
74+ # 上传文件
75+ $remotePath = "/SBGA/MaiChartManager Canary/$($appxFile.Name)"
76+ $encodedPath = [System.Uri]::EscapeDataString($remotePath)
77+
78+ $headers = @{
79+ "Authorization" = $env:ALIST_TOKEN
80+ "File-Path" = $encodedPath
81+ }
82+
83+ Invoke-RestMethod -Uri "$alistUrl/api/fs/put" -Method Put -InFile $appxFile.FullName -Headers $headers
84+
85+ Write-Host "Upload complete: $remotePath"
You can’t perform that action at this time.
0 commit comments