Skip to content

Commit

Permalink
🐳 自动发布和更新支持Win7
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiYu-233 committed Aug 27, 2024
1 parent 33dcd02 commit 74967f7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,32 @@ jobs:
cd ../../
cd ./osx-arm64/publish/
zip -9 -r ../../YMCL.Main.osx.mac.arm64.app.zip ./YMCL.app
- name: Build-WinExe
run: |
cd ./YMCL.Main
sudo su
dotnet publish -r win-x86 --self-contained true -p:PublishSingleFile=true
dotnet publish -r win-x64 --self-contained true -p:PublishSingleFile=true
dotnet publish -r win-arm64 --self-contained true -p:PublishSingleFile=true
mv ./bin/Release/net8.0/win-x86/publish/YMCL.Main.exe ./bin/Release/net8.0/win-x86/publish/YMCL.Main.win7+.x86.exe
mv ./bin/Release/net8.0/win-x64/publish/YMCL.Main.exe ./bin/Release/net8.0/win-x64/publish/YMCL.Main.win7+.x64.exe
mv ./bin/Release/net8.0/win-arm64/publish/YMCL.Main.exe ./bin/Release/net8.0/win-arm64/publish/YMCL.Main.win7+.arm64.exe
cd ./bin/Release/net8.0/
cd ./win-x86/publish/
zip -9 -r "../../YMCL.Main.win7+.x86.exe.zip" "./YMCL.Main.win7+.x86.exe"
cd ../../
cd ./win-x64/publish/
zip -9 -r "../../YMCL.Main.win7+.x64.exe.zip" "./YMCL.Main.win7+.x64.exe"
cd ../../
cd ./win-arm64/publish/
zip -9 -r "../../YMCL.Main.win7+.arm64.exe.zip" "./YMCL.Main.win7+.arm64.exe"
- name: UploadArtifacts
uses: actions/upload-artifact@v3
with:
name: linux-artifacts
path: |
YMCL.Main/Deploy/OUT/*
YMCL.Main/bin/Release/net8.0/YMCL.Main.osx.mac.x64.app.zip
YMCL.Main/bin/Release/net8.0/YMCL.Main.osx.mac.arm64.app.zip
YMCL.Main/bin/Release/net8.0/*.zip
win:
runs-on: windows-latest
Expand All @@ -102,9 +120,9 @@ jobs:
- name: Build
run: |
cd ./YMCL.Main
pupnet -r win-x64 -k setup -y -o YMCL.Main.win.x64.installer.exe --app-version ${{ needs.time.outputs.y }}.${{ needs.time.outputs.md }}.${{ needs.time.outputs.hm }}
pupnet -r win-x86 -k setup -y -o YMCL.Main.win.x86.installer.exe --app-version ${{ needs.time.outputs.y }}.${{ needs.time.outputs.md }}.${{ needs.time.outputs.hm }}
pupnet -r win-arm64 -k setup -y -o YMCL.Main.win.arm64.installer.exe --app-version ${{ needs.time.outputs.y }}.${{ needs.time.outputs.md }}.${{ needs.time.outputs.hm }}
pupnet -r win-x64 -k setup -y -o YMCL.Main.win10+.x64.installer.exe --app-version ${{ needs.time.outputs.y }}.${{ needs.time.outputs.md }}.${{ needs.time.outputs.hm }}
pupnet -r win-x86 -k setup -y -o YMCL.Main.win10+.x86.installer.exe --app-version ${{ needs.time.outputs.y }}.${{ needs.time.outputs.md }}.${{ needs.time.outputs.hm }}
pupnet -r win-arm64 -k setup -y -o YMCL.Main.win10+.arm64.installer.exe --app-version ${{ needs.time.outputs.y }}.${{ needs.time.outputs.md }}.${{ needs.time.outputs.hm }}
- name: UploadArtifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -144,5 +162,4 @@ jobs:
files: |
YMCL.Release/*.exe
YMCL.Release/Deploy/OUT/*.AppImage
YMCL.Release/bin/Release/net8.0/YMCL.Main.osx.mac.x64.app.zip
YMCL.Release/bin/Release/net8.0/YMCL.Main.osx.mac.arm64.app.zip
YMCL.Release/bin/Release/net8.0/*.zip
11 changes: 8 additions & 3 deletions YMCL.Main/Public/Method.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,12 @@ public static async Task<bool> UpdateAppAsync()
case "YMCL.Main.linux.x64.AppImage" when architecture == "linux-x64":
case "YMCL.Main.osx.mac.x64.app.zip" when architecture == "osx-x64":
case "YMCL.Main.osx.mac.arm64.app.zip" when architecture == "osx-arm64":
case "YMCL.Main.win.x64.installer.exe" when architecture == "win-x64":
case "YMCL.Main.win.x86.installer.exe" when architecture == "win-x86":
case "YMCL.Main.win10+.x64.installer.exe" when architecture == "win-x64" && Environment.OSVersion.Version.Major >= 10:
case "YMCL.Main.win10+.x86.installer.exe" when architecture == "win-x86" && Environment.OSVersion.Version.Major >= 10:
case "YMCL.Main.win10+.arm64.installer.exe" when architecture == "win-arm64" && Environment.OSVersion.Version.Major >= 10:
case "YMCL.Main.win7+.x64.exe.zip" when architecture == "win-x64" && Environment.OSVersion.Version.Major >= 7:
case "YMCL.Main.win7+.arm64.exe.zip" when architecture == "win-arm64" && Environment.OSVersion.Version.Major >= 7:
case "YMCL.Main.win7+.x86.exe.zip" when architecture == "win-x86" && Environment.OSVersion.Version.Major >= 7:
url = browser_download_url;
fileName = name;
break;
Expand Down Expand Up @@ -405,7 +409,8 @@ await downloadStream.ReadAsync(buffer)) > 0)
}

task.UpdateTextProgress($"{MainLang.DownloadFinish}");
if (architecture == "win-x86" || architecture == "win-x64")
if ((architecture == "win-x86" || architecture == "win-x64") &&
Environment.OSVersion.Version.Major >= 10)
{
var startInfo = new ProcessStartInfo
{
Expand Down

0 comments on commit 74967f7

Please sign in to comment.