Skip to content

Commit

Permalink
Merge pull request #3 from YuehaiTeam/main
Browse files Browse the repository at this point in the history
pack installer
  • Loading branch information
huiyadanli authored Jan 15, 2025
2 parents 1f11162 + a63fcc9 commit b9b4a93
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 17 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,8 @@ jobs:
with:
name: scripts
path: dist/BetterGI/Assets/Web/ScriptRepo
- name: download hdiffz
- name: Extract Map
run: |
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/sisong/HDiffPatch/releases/latest"
$downloadUrl = $response.assets | Where-Object { $_.name -like "*windows64*.zip" } | Select-Object -ExpandProperty browser_download_url
$zipFilePath = "hdiffpatch_windows64.zip"
$outputFolder = "hdiffpatch"
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipFilePath
if (-Not (Test-Path -Path $outputFolder)) {
New-Item -ItemType Directory -Path $outputFolder
}
Expand-Archive -Path $zipFilePath -DestinationPath $outputFolder -Force
$exeFile = Get-ChildItem -Path $searchPath -Recurse -File -Filter "hdiffz.exe" | Select-Object -First 1
Move-Item -Path $exeFile.FullName -Destination . -Force
Remove-Item -Path $outputFolder -Recurse -Force
Remove-Item -Path $zipFilePath
- run: |
Get-ChildItem -Filter *.zst | ForEach-Object {
if ($_.PSIsContainer -eq $false) {
$file = $_.Name
Expand All @@ -118,10 +104,32 @@ jobs:
Write-Host "$file -> $output_file"
}
}
- name: Download kachina-builder
run: |
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/YuehaiTeam/kachina-installer/releases/latest"
$downloadUrl = $response.assets | Where-Object { $_.name -like "kachina-builder.exe" } | Select-Object -ExpandProperty browser_download_url
$zipFilePath = "kachina-builder.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipFilePath
- name: Pack kachina-builder
run: |
cd dist
..\kachina-builder.exe gen -i BetterGI -m metadata.json -o hashed -r babalae/bettergi -t ${{ needs.build_main.outputs.version }} --diff-ignore *[.txt,.onnx]
..\kachina-builder.exe pack -c ../kachina.config.json -o BetterGI/BetterGI.update.exe
..\kachina-builder.exe pack -c ../kachina.config.json -m metadata.json -d hashed -o BetterGI.Install.${{ needs.build_main.outputs.version }}.exe
- name: Generate archive
run: |
cd dist
7z a dfs.tar hashed/ metadata.json -r -y
7z a "BetterGI_v${{ needs.build_main.outputs.version }}.7z" BetterGI -t7z -mx=5 -mf=BCJ2 -r -y
- uses: actions/upload-artifact@v4
with:
name: publish
path: dist/BetterGI_*
path: dist/BetterGI_*.7z
- uses: actions/upload-artifact@v4
with:
name: dfs
path: dist/dfs.tar
- uses: actions/upload-artifact@v4
with:
name: installer
path: dist/BetterGI.Install.*.exe
15 changes: 15 additions & 0 deletions kachina.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"dfsPath": "bgi",
"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"]
}

0 comments on commit b9b4a93

Please sign in to comment.