@@ -122,12 +122,47 @@ jobs:
122122 # self-hosted runner 已配 .NET SDK / Windows SDK / D:\Sign\signcode.cmd
123123 run : .\Packaging\Build.ps1 -Mode Canary
124124
125- - name : Upload Appx
125+ - name : Upload Appx artifact
126126 uses : actions/upload-artifact@v4
127127 with :
128128 name : ChuChartManager-Canary-Appx
129129 path : Packaging/ChuChartManager_Canary_*.appx
130130
131+ - name : Upload to Alist
132+ shell : pwsh
133+ env :
134+ ALIST_TOKEN : ${{ secrets.ALIST_TOKEN }}
135+ run : |
136+ $alistUrl = "https://alist.c5y.moe"
137+
138+ $appxFile = Get-ChildItem -Path "Packaging" -Filter "ChuChartManager_Canary_*.appx" | Select-Object -First 1
139+ if (-not $appxFile) { throw "No appx file found!" }
140+
141+ Write-Host "Uploading $($appxFile.Name)..."
142+
143+ $remotePath = "/SBGA/ChuChartManager Canary/$($appxFile.Name)"
144+ $encodedPath = [System.Uri]::EscapeDataString($remotePath)
145+
146+ $headers = @{
147+ "Authorization" = $env:ALIST_TOKEN
148+ "File-Path" = $encodedPath
149+ }
150+
151+ Invoke-RestMethod -Uri "$alistUrl/api/fs/put" -Method Put -InFile $appxFile.FullName -Headers $headers
152+ Write-Host "Upload complete: $remotePath"
153+
154+ - name : Update AppInstaller Config
155+ shell : pwsh
156+ run : |
157+ $appxFile = Get-ChildItem -Path "Packaging" -Filter "ChuChartManager_Canary_*.appx" | Select-Object -First 1
158+ if (-not $appxFile) { throw "Appx file not found for version extraction!" }
159+
160+ # 从 ChuChartManager_Canary_X.Y.Z.W.appx 提取版本号
161+ $version = $appxFile.Name -replace 'ChuChartManager_Canary_', '' -replace '\.appx$', ''
162+ Write-Host "Detected Version: $version"
163+
164+ & "D:\sign\ccm-canary-update.ps1" -Version $version
165+
131166 release :
132167 name : Release
133168 if : startsWith(github.ref, 'refs/tags/v')
0 commit comments