@@ -371,41 +371,83 @@ jobs:
371371 mirrorchyan_uploading :
372372 if : github.repository_owner == 'babalae' && contains(needs.validate.outputs.version, '-')
373373 needs : [validate, build_dist, build_installer]
374- runs-on : macos -latest
374+ runs-on : windows -latest
375375 steps :
376376
377377 - uses : actions/download-artifact@v4
378378 with :
379379 path : downloads
380380 github-token : ${{ secrets.GITHUB_TOKEN }}
381+
382+ - name : 📥 Download kachina-builder release
383+ if : ${{ github.event.inputs.kachina-channel == 'release' }}
384+ uses : robinraju/release-downloader@v1.8
385+ with :
386+ repository : " YuehaiTeam/kachina-installer"
387+ latest : true
388+ fileName : " kachina-builder.exe"
389+ - name : 📥 Download kachina-builder dev
390+ if : ${{ github.event.inputs.kachina-channel == 'dev' }}
391+ uses : dawidd6/action-download-artifact@v8
392+ with :
393+ github_token : ${{secrets.GITHUB_TOKEN}}
394+ repo : " YuehaiTeam/kachina-installer"
395+ workflow : " build.yml"
396+ name : artifact
397+ branch : main
398+ event : push
399+ workflow_conclusion : success
381400
382- - name : Extract 7z
401+ - name : Embed Dotnet and VCRedist
402+ shell : bash
403+ run : |
404+ # dotnet
405+ VERSION_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0/latest.version"
406+ VERSION=$(curl -fsSL "$VERSION_URL" | tr -d '\r\n')
407+ if [ -z "$VERSION" ]; then
408+ echo "Cannot get the latest version from $VERSION_URL"
409+ exit 1
410+ fi
411+ INSTALLER_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/${VERSION}/windowsdesktop-runtime-${VERSION}-win-x64.exe"
412+ OUTPUT="windowsdesktop-runtime-${VERSION}-win-x64.exe"
413+ echo "Downloading Windows Desktop Runtime version $VERSION from $INSTALLER_URL"
414+ curl -fSL -o "$OUTPUT" "$INSTALLER_URL"
415+ # vcredist
416+ echo "Downloading VCRedist"
417+ curl -fSL -o "vc_redist.x64.exe" "https://aka.ms/vs/17/release/vc_redist.x64.exe"
418+ # embed
419+ echo "Embedding runtimes"
420+ ./kachina-builder.exe append -o ./downloads/BetterGI_Install/BetterGI.Install.*.exe -f "$OUTPUT" -n "Microsoft.DotNet.DesktopRuntime.8" -f "vc_redist.x64.exe" -n "Microsoft.VCRedist.2015+.x64"
421+
422+ - name : Extract 7z and create zip
383423 shell : bash
384424 run : |
385425 cd downloads/BetterGI_7z
386426 7z x BetterGI_v*.7z -oun7z
387427 mv ../BetterGI_Metadata/metadata.json ./un7z/BetterGI/.metadata.json
428+ 7z a -tzip BetterGI.zip un7z/BetterGI -mx=5 -mf=BCJ2 -r -y
429+ ls .
430+ ls ./un7z/BetterGI
431+ choco install wget --no-progress
388432
389433 - name : Upload Zip
390434 uses : MirrorChyan/uploading-action@v1
391435 with :
392436 filetype : local
393437 mirrorchyan_rid : BGI
394- working-directory : downloads/BetterGI_7z/un7z/
395- pick_files : ' ["BetterGI"]'
438+ filename : " downloads/BetterGI_7z/BetterGI.zip"
396439 version_name : ${{ needs.validate.outputs.version }}
397440 upload_token : ${{ secrets.MirrorChyanUploadToken }}
398441 os : win
399442 arch : x64
400-
443+
401444 - name : Upload Install.exe
445+ if : always()
402446 uses : MirrorChyan/uploading-action@v1
403447 with :
404448 filetype : local
405449 mirrorchyan_rid : BGI
406- working-directory : downloads/BetterGI_Install/
407- filename : " BetterGI.Install.*.exe"
408- extra_zip : true
450+ filename : " downloads/BetterGI_Install/BetterGI.Install.*.exe"
409451 version_name : ${{ needs.validate.outputs.version }}
410452 upload_token : ${{ secrets.MirrorChyanUploadToken }}
411453
0 commit comments