Skip to content

Commit 1f91cf9

Browse files
committed
feat: upload
1 parent 70aab93 commit 1f91cf9

3 files changed

Lines changed: 39 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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')

Packaging/AppxManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
77
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
88
IgnorableNamespaces="win32dependencies">
9-
<!-- Identity 中 Name/Publisher 为占位符,发布到微软商店前由实际值替换 -->
10-
<Identity Name="PLACEHOLDER.ChuChartManager"
9+
<!-- Identity 中 Name/Publisher 为占位符,发布到微软商店前由实际值替换;Canary 用 MuNET.ChuChartManager (自动加 .Canary 后缀) -->
10+
<Identity Name="MuNET.ChuChartManager"
1111
Publisher="CN=PLACEHOLDER-MS-STORE"
1212
Version="0.1.0.0"
1313
ProcessorArchitecture="x64" />

Packaging/Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ $xml.Package.Identity.Version = $BuildVersion
143143

144144
if ($Mode -eq "Canary") {
145145
# Canary 用自签证书 + 独立 Identity,避免覆盖未来的商店版
146-
$xml.Package.Identity.Name = $xml.Package.Identity.Name + ".Canary"
146+
$xml.Package.Identity.Name = "MuNET.ChuChartManager.Canary"
147147
$xml.Package.Identity.Publisher = $CanaryPublisher
148148
$xml.Package.Properties.DisplayName = "ChuChartManager (Canary)"
149149
$xml.Package.Properties.PublisherDisplayName = "凌莞"

0 commit comments

Comments
 (0)