diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4deaefe3..1d5ca029 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,9 +15,11 @@ on: options: - release - dev - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+*' + create-release: + type: boolean + description: '是否创建 GitHub Release 草稿' + required: true + default: false jobs: # Add validation job to check version format @@ -281,7 +283,7 @@ jobs: run: | cd dist ..\kachina-builder.exe gen -j 6 -i BetterGI -m metadata.json -o hashed -r babalae/bettergi -t ${{ needs.validate.outputs.version }} --diff-vers ..\last\BetterGI --diff-vers ..\2nd\BetterGI --diff-vers ..\3rd\BetterGI --diff-ignore *[.txt,.onnx] -u .\BetterGI\BetterGI.update.exe - ..\kachina-builder.exe pack -c ../kachina.config.json -m metadata.json -d hashed -o BetterGI.Install.${{ needs.validate.outputs.version }}.exe + ..\kachina-builder.exe pack -c ../Build/kachina.config.json -m metadata.json -d hashed -o BetterGI.Install.${{ needs.validate.outputs.version }}.exe - uses: actions/upload-artifact@v4 with: name: BetterGI_Install @@ -318,13 +320,36 @@ jobs: foreach ($archive in $archiveFiles) { & 7z x $archive.FullName } - .\makemica.exe micasetup.json + .\makemica.exe Build\micasetup.json ren BetterGI_Setup.exe BetterGI_Setup_v${{ needs.validate.outputs.version }}.exe - uses: actions/upload-artifact@v4 with: name: BetterGI_Setup path: BetterGI_Setup*.exe + # 创建 GitHub Release + create_release: + if: github.event.inputs.create-release == 'true' + needs: [validate, build_dist, build_installer] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ needs.validate.outputs.version }} + name: BetterGI v${{ needs.validate.outputs.version }} + draft: true + prerelease: ${{ contains(needs.validate.outputs.version, '-') }} + files: | + artifacts/BetterGI_7z/*.7z + artifacts/BetterGI_Install/*.exe + mirrorchyan_uploading: if: github.repository_owner == 'babalae' needs: [validate, build_dist, build_installer] diff --git a/Build/kachina.config.json b/Build/kachina.config.json new file mode 100644 index 00000000..d7399b91 --- /dev/null +++ b/Build/kachina.config.json @@ -0,0 +1,38 @@ +{ +<<<<<<< HEAD + "source": "dfs+packed+https://steambird.cocogoat.cn/dfs/bgi/BetterGI.Install.exe", +======= + "source": [ + { + "id": "dfs", + "name": "默认服务器", + "uri": "dfs+packed+https://77.cocogoat.cn/v2/dfs/bgi/BetterGI.Install.exe" + }, + { + "id": "mirrorc", + "name": "Mirror酱", + "uri": "mirrorc://BGI" + }, + { + "id": "mirrorc-beta", + "name": "Mirror酱 beta", + "uri": "mirrorc://BGI?channel=beta", + "hidden": true + } + ], +>>>>>>> 9eee2aecbe2b5dce26425bf67f4d5a0451dcccfe + "appName": "BetterGI", + "publisher": "babalae", + "regName": "BetterGI", + "exeName": "BetterGI.exe", + "uninstallName": "BetterGI.uninst.exe", + "updaterName": "BetterGI.update.exe", + "programFilesPath": "BetterGI", + "title": "BetterGI", + "description": "更好的原神,免费且开源", + "windowTitle": "BetterGI 安装程序", + "userDataPath": ["${INSTALL_PATH}/User"], + "extraUninstallPath": ["${INSTALL_PATH}/log"], + "uacStrategy": "prefer-admin", + "runtimes": ["Microsoft.DotNet.DesktopRuntime.8", "Microsoft.VCRedist.2015+.x64"] +} diff --git a/Build/micasetup.json b/Build/micasetup.json new file mode 100644 index 00000000..67b4b7df --- /dev/null +++ b/Build/micasetup.json @@ -0,0 +1,42 @@ +{ + "Template": "${MicaDir}/template/default.7z", + "Package": "./publish.7z", + "Output": "./${AppName}_Setup.exe", + "AppName": "BetterGI", + "KeyName": "BetterGI", + "ExeName": "BetterGI.exe", + "Publisher": "huiyadanli", + "TargetFramework": "net472", + "Guid": "00000000-0000-0000-0000-000000000000", + "Favicon": "./img/Favicon.png", + "Icon": "./img/FaviconSetup.png", + "UnIcon": "./img/FaviconUninst.png", + "LicenseFile": "LICENSE", + "License": null, + "LicenseType": null, + "RequestExecutionLevel": "admin", + "SingleInstanceMutex": null, + "IsCreateDesktopShortcut": true, + "IsCreateUninst": true, + "IsCreateStartMenu": true, + "IsPinToStartMenu": false, + "IsCreateQuickLaunch": false, + "IsCreateRegistryKeys": true, + "IsCreateAsAutoRun": false, + "IsCustomizeVisiableAutoRun": false, + "AutoRunLaunchCommand": "-autostart", + "IsUseFolderPickerPreferClassic": false, + "IsUseInstallPathPreferX86": false, + "IsUseRegistryPreferX86": null, + "IsAllowFullFolderSecurity": true, + "IsAllowFirewall": true, + "IsRefreshExplorer": true, + "IsInstallCertificate": false, + "IsEnableUninstallDelayUntilReboot": true, + "IsEnvironmentVariable": false, + "OverlayInstallRemoveExt": "exe,dll,pdb", + "UnpackingPassword": null, + "MessageOfPage1": null, + "MessageOfPage2": null, + "MessageOfPage3": null +} diff --git a/Build/micasetup/Favicon.ico b/Build/micasetup/Favicon.ico new file mode 100644 index 00000000..a2d7af65 Binary files /dev/null and b/Build/micasetup/Favicon.ico differ diff --git a/Build/micasetup/Favicon.png b/Build/micasetup/Favicon.png new file mode 100644 index 00000000..1390a0ba Binary files /dev/null and b/Build/micasetup/Favicon.png differ diff --git a/Build/micasetup/FaviconSetup.ico b/Build/micasetup/FaviconSetup.ico new file mode 100644 index 00000000..ae0a2ccf Binary files /dev/null and b/Build/micasetup/FaviconSetup.ico differ diff --git a/Build/micasetup/FaviconSetup.png b/Build/micasetup/FaviconSetup.png new file mode 100644 index 00000000..40cc53b0 Binary files /dev/null and b/Build/micasetup/FaviconSetup.png differ diff --git a/Build/micasetup/FaviconUninst.ico b/Build/micasetup/FaviconUninst.ico new file mode 100644 index 00000000..4d04864b Binary files /dev/null and b/Build/micasetup/FaviconUninst.ico differ diff --git a/Build/micasetup/FaviconUninst.png b/Build/micasetup/FaviconUninst.png new file mode 100644 index 00000000..28e1ecca Binary files /dev/null and b/Build/micasetup/FaviconUninst.png differ