Skip to content

feat: 导入自制谱 + 复制导出菜单 + 清理旧转谱代码 #19

feat: 导入自制谱 + 复制导出菜单 + 清理旧转谱代码

feat: 导入自制谱 + 复制导出菜单 + 清理旧转谱代码 #19

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
check-frontend:
name: Check Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Install
working-directory: ChuChartManager/Front
run: pnpm install
- name: Type Check
working-directory: ChuChartManager/Front
run: pnpm vue-tsc --noEmit
- name: Build
working-directory: ChuChartManager/Front
run: pnpm build
- name: Upload wwwroot
uses: actions/upload-artifact@v4
with:
name: wwwroot
path: ChuChartManager/wwwroot
check-backend:
name: Check Backend
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Build
run: dotnet build ChuChartManager/ChuChartManager.csproj -c Release
build:
name: Build (zip)
runs-on: windows-latest
needs: [check-frontend, check-backend]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Build Frontend
working-directory: ChuChartManager/Front
run: |
pnpm install
pnpm build
- name: Publish
run: dotnet publish ChuChartManager/ChuChartManager.csproj -c Release -r win-x64 --self-contained -o publish /p:PublishSingleFile=false /p:ErrorOnDuplicatePublishOutputFiles=false
- name: Package
shell: pwsh
run: Compress-Archive -Path publish/* -DestinationPath ChuChartManager-win-x64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ChuChartManager-win-x64
path: ChuChartManager-win-x64.zip
build-canary-appx:
name: Build Canary Appx
runs-on: self-hosted
needs: [check-frontend]
steps:
- run: git config --global core.longPaths true
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Download wwwroot
uses: actions/download-artifact@v4
with:
name: wwwroot
path: ChuChartManager/wwwroot
- name: Build Appx
shell: pwsh
# self-hosted runner 已配 .NET SDK / Windows SDK / D:\Sign\signcode.cmd
run: .\Packaging\Build.ps1 -Mode Canary
- name: Upload Appx artifact
uses: actions/upload-artifact@v4
with:
name: ChuChartManager-Canary-Appx
path: Packaging/ChuChartManager_Canary_*.appx
- name: Upload to Alist
shell: pwsh
env:
ALIST_TOKEN: ${{ secrets.ALIST_TOKEN }}
run: |
$alistUrl = "https://alist.c5y.moe"
$appxFile = Get-ChildItem -Path "Packaging" -Filter "ChuChartManager_Canary_*.appx" | Select-Object -First 1
if (-not $appxFile) { throw "No appx file found!" }
Write-Host "Uploading $($appxFile.Name)..."
$remotePath = "/SBGA/ChuChartManager Canary/$($appxFile.Name)"
$encodedPath = [System.Uri]::EscapeDataString($remotePath)
$headers = @{
"Authorization" = $env:ALIST_TOKEN
"File-Path" = $encodedPath
}
Invoke-RestMethod -Uri "$alistUrl/api/fs/put" -Method Put -InFile $appxFile.FullName -Headers $headers
Write-Host "Upload complete: $remotePath"
- name: Update AppInstaller Config
shell: powershell
run: |
$appxFile = Get-ChildItem -Path "Packaging" -Filter "ChuChartManager_Canary_*.appx" | Select-Object -First 1
if (-not $appxFile) { throw "Appx file not found for version extraction!" }
# 从 ChuChartManager_Canary_X.Y.Z.W.appx 提取版本号
$version = $appxFile.Name -replace 'ChuChartManager_Canary_', '' -replace '\.appx$', ''
Write-Host "Detected Version: $version"
& "D:\sign\ccm-canary-update.ps1" -Version $version
release:
name: Release
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: ChuChartManager-win-x64
- uses: softprops/action-gh-release@v2
with:
files: ChuChartManager-win-x64.zip
generate_release_notes: true
prerelease: false