Skip to content

Commit

Permalink
feat: 适配 .NET6
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWRC committed Feb 8, 2025
1 parent e65c6d0 commit fabf331
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 39 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,3 @@ jobs:
bodyFile: ./out/ChangeLogs.md
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event_name != 'workflow_dispatch' && github.ref || github.event.inputs.release_tag }}
- name: Upload Nuget packages to NuGet Gallery
if: ${{ github.event_name != 'pull_request' }}
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
run: |
ls
cd out
dotnet nuget push *.nupkg -k $env:NUGET_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload to AppCenter
env:
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
run: |
$env:app_ver = (git describe --abbrev=0 --tags)
Write-Host "Uploading to AppCenter..." -ForegroundColor Cyan
pwsh -ep Bypass -c .\tools\release-gen\pre-appcenter-upload.ps1
pwsh -ep Bypass -c .\tools\release-gen\appcenter-upload.ps1 $env:APPCENTER_TOKEN $env:app_ver
1 change: 1 addition & 0 deletions ClassIsland/ClassIsland.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
Expand Down
7 changes: 4 additions & 3 deletions ClassIsland/Services/AppUpdating/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class UpdateService : IHostedService, INotifyPropertyChanged
internal static string UpdateCachePath { get; } = Path.Combine(App.AppCacheFolderPath, "Update");

internal const string UpdateMetadataUrl =
"https://get.classisland.tech/p/ClassIsland-Ningbo-S3/classisland/disturb/index.json";
"https://get.classisland.tech/p/ClassIsland-Ningbo-S3/classisland/disturb-net6/index.json";

public static string UpdateTempPath =>
#if IsMsix
Expand Down Expand Up @@ -444,8 +444,9 @@ private async Task ValidateUpdateAsync()
}

await using var stream = File.OpenRead(Path.Combine(UpdateTempPath, @"./update.zip"));
var sha256 = await SHA256.HashDataAsync(stream);
var str = BitConverter.ToString(sha256);
var sha256 = SHA256.Create();
var result = await sha256.ComputeHashAsync(stream);
var str = BitConverter.ToString(result);
str = str.Replace("-", "");
Logger.LogDebug("更新文件哈希:{}", str);
if (!string.Equals(str, Settings.UpdateArtifactHash, StringComparison.CurrentCultureIgnoreCase))
Expand Down
2 changes: 1 addition & 1 deletion ClassIsland/Views/SettingPages/DebugPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void TargetTime_OnChanged(object sender, RoutedEventArgs e)
if (!ViewModel.IsTargetDateTimeLoaded) return;

DateTime now = ExactTimeService.GetCurrentLocalDateTime();
DateTime tar = new(DateOnly.FromDateTime(now), TimeOnly.FromDateTime(ViewModel.TargetTime));
var tar = now.Date + now.TimeOfDay;

SettingsService.Settings.DebugTimeOffsetSeconds += Math.Round((tar - now).TotalSeconds);
}
Expand Down
34 changes: 30 additions & 4 deletions doc/ChangeLogs/1.6/1.5.4.1/App.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,38 @@

1.6 - Himeko

本版本包括对 1.5.4.0 的一些重要 Bug 修复,请及时更新。如果您已经无法启动 1.5.4.0 版本的 ClassIsland,可以直接在下方下载对应架构的应用包,然后直接替换 ClassIsland.exe 完成升级。很抱歉给各位用户带来的不便
🎉 本版本是 1.6 的最后一个 Beta 版,将在确认稳定并修复在这个版本收到的问题后,在下一个版本发布 1.6 的正式版

> 1.6 - Himeko 测试版,可能包含未完善和不稳定的功能
## 🐛 Bug 修复
## 🚀 新增功能与优化

- **【自动化】触发器:** 支持使用触发器启动自动化工作流
- **【自动化】行动时间点:** 从时间表运行行动 [#119](https://github.com/ClassIsland/ClassIsland/issues/119)
- **【档案】调课面板:** 支持提前预定换课课表和跨课表换课 [#321](https://github.com/ClassIsland/ClassIsland/issues/321) [#373](https://github.com/ClassIsland/ClassIsland/issues/373) [#617](https://github.com/ClassIsland/ClassIsland/issues/617)
- 【自动化】工作流允许不恢复和不考虑条件
- 【自动化/行动】添加提醒行动
- 【自动化/行动】通过行动显示天气提醒 [#494](https://github.com/ClassIsland/ClassIsland/issues/494)
- 【档案编辑器】优化档案编辑器行动编辑外观
- 【档案编辑器】分割线、行动时间点拖动功能 [#153](https://github.com/ClassIsland/ClassIsland/issues/153)
- 【档案编辑器】改进时间点添加体验
- 【档案】预定启用临时层课表 [#321](https://github.com/ClassIsland/ClassIsland/issues/321)
- 【档案】支持 CSES 课表格式转换 [#642](https://github.com/ClassIsland/ClassIsland/issues/642)
- 【档案/自动化】添加档案信任机制
- 【UI】修改崩溃窗口文字
- 【UI】开发中画面水印
- 【组件/课表】隐藏上过的课程 [#193](https://github.com/ClassIsland/ClassIsland/issues/193) ([#648](https://github.com/ClassIsland/ClassIsland/issues/648) by @itsHenry35)
- 【组件/课表】模糊倒计时 [#313](https://github.com/ClassIsland/ClassIsland/issues/313)
- 【组件/天气简报】气象预警图标增加预警类型表示 [#568](https://github.com/ClassIsland/ClassIsland/issues/568)
- 【组件/天气简报】显示降水提示 [#176](https://github.com/ClassIsland/ClassIsland/issues/176)
- 【提醒】下课提醒文字自定义 [#341](https://github.com/ClassIsland/ClassIsland/issues/341)
- 【提醒/天气】支持按小时显示天气预报 [#184](https://github.com/ClassIsland/ClassIsland/issues/184)
- 【日志】日志、插件搜索忽略大小写
- 【调试】不保存调试时间和时间流速对时间偏移的改动

- 【更新】修复更新服务循环引用属性,造成应用崩溃的问题。 #662 #657
## 🐛 Bug 修复

1.5.4.0 更新日志:<https://github.com/ClassIsland/ClassIsland/releases/tag/1.5.4.0>
- 【应用设置】修复应用设置导航栏排序可能不正常的问题
- 【档案编辑器】修复删除时间点时卡顿的问题
- 【主界面】修复应用启动后不会应用反转指针移入隐藏的问题
- 【主界面】修复在加载课表组件时找不到资源“ClassPlanCollectionViewSource”的问题
24 changes: 12 additions & 12 deletions tools/release-gen/upload.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Import-Module ./tools/release-gen/alist-utils.psm1

# Generate metadata & upload artifacts
Write-Output "Generating metadata & uploading artifacts"
Copy-Item ./out_signed/* -Destination ./out/ -Recurse -Force
Copy-Item ./out_artifacts/* -Destination ./out/ -Recurse -Force

$version = $(git describe --abbrev=0 --tags)
$gitCommitId = $(git rev-parse HEAD)
Expand Down Expand Up @@ -59,13 +59,13 @@ foreach ($artifact in $artifacts){
$downloadInfo = @{
"DeployMethod" = $deployMethodId
"ArchiveDownloadUrls" = @{
"main" = "https://get.classisland.tech/p/ClassIsland-Ningbo-S3/classisland/disturb/${version}/$($artifact.Name)"
"github-origin" = "https://github.com/ClassIsland/ClassIsland/releases/download/${version}/$($artifact.Name)"
"main" = "https://get.classisland.tech/p/ClassIsland-Ningbo-S3/classisland/disturb-net6/${version}/$($artifact.Name)"
"github-origin" = "https://github.com/ClassIsland/ClassIsland-net6/releases/download/${version}/$($artifact.Name)"
}
"ArchiveSHA256"= $(Get-FileHash $artifact -Algorithm SHA256).Hash
}
Write-Output "Uploading artifact $artifactId"
UploadFile $artifact.FullName "ClassIsland-Ningbo-S3/classisland/disturb/${version}/"
UploadFile $artifact.FullName "ClassIsland-Ningbo-S3/classisland/disturb-net6/${version}/"
$versionInfo.DownloadInfos[$artifactId] = $downloadInfo
$hashSummary += "| $($artifact.Name) | ``$($downloadInfo.ArchiveSHA256)`` |`n"
$legaceyMD5Hashes.Add($artifact.Name, (Get-FileHash $artifact -Algorithm MD5).Hash)
Expand Down Expand Up @@ -94,21 +94,21 @@ git config --global user.email '[email protected]'
git clone git@github.com:ClassIsland/metadata.git
cd metadata

git checkout -b metadata/disturb/$version
if ($(Test-Path ./metadata/disturb/$version) -eq $false) {
mkdir ./metadata/disturb/$version
git checkout -b metadata/disturb-net6/$version
if ($(Test-Path ./metadata/disturb-net6/$version) -eq $false) {
mkdir ./metadata/disturb-net6/$version
}
Copy-Item ../out/index.json -Destination ./metadata/disturb/$version/index.json -Force
$globalIndex = ConvertFrom-Json (Get-Content ./metadata/disturb/index.json -Raw)
Copy-Item ../out/index.json -Destination ./metadata/disturb-net6/$version/index.json -Force
$globalIndex = ConvertFrom-Json (Get-Content ./metadata/disturb-net6/index.json -Raw)
$globalIndex.Versions = [System.Collections.ArrayList]@($globalIndex.Versions)
$globalIndex.Versions.Add(@{
Version = $version
Title = $version
Channels = $tagInfo.Channels
VersionInfoUrl = "https://get.classisland.tech/p/ClassIsland-Ningbo-S3/classisland/disturb/${version}/index.json"
})
ConvertTo-Json $globalIndex -Depth 99 | Out-File ./metadata/disturb/index.json
ConvertTo-Json $globalIndex -Depth 99 | Out-File ./metadata/disturb-net6/index.json
git add .
git commit -m "metadata(disturb): release $version at https://github.com/ClassIsland/ClassIsland/commit/$gitCommitId"
git push origin metadata/disturb/$version
gh pr create -R ClassIsland/metadata -t "Add metadata for $version" -b "Add metadata for $version at https://github.com/ClassIsland/ClassIsland/commit/$gitCommitId" -B main -a HelloWRC
git push origin metadata/disturb-net6/$version
gh pr create -R ClassIsland/metadata -t "Add metadata for $version" -b "Add metadata for $version at https://github.com/ClassIsland/ClassIsland-net6/commit/$gitCommitId" -B main -a HelloWRC

0 comments on commit fabf331

Please sign in to comment.