From e0aa5f0821dfd688416baa4945c6356d0be57467 Mon Sep 17 00:00:00 2001 From: xyToki <7547189+xytoki@users.noreply.github.com> Date: Sun, 22 Jun 2025 16:18:17 +0800 Subject: [PATCH] ci: update mirrorc release pipeline --- .github/workflows/mirrorchyan_uploading.yml | 62 +++++++++++++++------ .github/workflows/publish.yml | 1 - 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/.github/workflows/mirrorchyan_uploading.yml b/.github/workflows/mirrorchyan_uploading.yml index 9da5f085..f6d1ccde 100644 --- a/.github/workflows/mirrorchyan_uploading.yml +++ b/.github/workflows/mirrorchyan_uploading.yml @@ -6,8 +6,8 @@ on: types: [released] jobs: - mirrorchyan_7z: - runs-on: macos-latest + mirrorchyan: + runs-on: windows-latest steps: - name: 📥 Download release uses: robinraju/release-downloader@v1.8 @@ -15,11 +15,45 @@ jobs: latest: true fileName: "*" - - name: Extract 7z + - name: 📥 Download kachina-builder release + if: ${{ github.event.inputs.kachina-channel == 'release' }} + uses: robinraju/release-downloader@v1.8 + with: + repository: "YuehaiTeam/kachina-installer" + latest: true + fileName: "kachina-builder.exe" + + - name: Embed Dotnet and VCRedist shell: bash run: | + # dotnet + VERSION_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0/latest.version" + VERSION=$(curl -fsSL "$VERSION_URL" | tr -d '\r\n') + if [ -z "$VERSION" ]; then + echo "Cannot get the latest version from $VERSION_URL" + exit 1 + fi + INSTALLER_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/${VERSION}/windowsdesktop-runtime-${VERSION}-win-x64.exe" + OUTPUT="windowsdesktop-runtime-${VERSION}-win-x64.exe" + echo "Downloading Windows Desktop Runtime version $VERSION from $INSTALLER_URL" + curl -fSL -o "$OUTPUT" "$INSTALLER_URL" + # vcredist + echo "Downloading VCRedist" + curl -fSL -o "vc_redist.x64.exe" "https://aka.ms/vs/17/release/vc_redist.x64.exe" + # embed + echo "Embedding runtimes" + ./kachina-builder.exe append -o ./BetterGI.Install.*.exe -f "$OUTPUT" -n "Microsoft.DotNet.DesktopRuntime.8" -f "vc_redist.x64.exe" -n "Microsoft.VCRedist.2015+.x64" + ./kachina-builder.exe extract -i ./BetterGI.Install.*.exe -f ./metadata.json -n "\0META" + + - name: Extract 7z and create zip + shell: bash + run: | + 7z a -tzip BetterGI.Install.zip ./BetterGI.Install.*.exe -mx=1 -r -y + choco install wget --no-progress 7z x BetterGI_v*.7z -oun7z - mv ./BetterGI.Metadata.json ./un7z/BetterGI/.metadata.json + mv ./metadata.json ./un7z/BetterGI/.metadata.json + cd un7z + 7z a -tzip ../BetterGI.zip ./BetterGI -mx=5 -r -y - name: Determine version number id: get-version @@ -38,25 +72,17 @@ jobs: with: filetype: local mirrorchyan_rid: BGI - working-directory: ./un7z/ - pick_files: '["BetterGI"]' + filename: "downloads/BetterGI_7z/BetterGI.zip" version_name: ${{ steps.get-version.outputs.version }} upload_token: ${{ secrets.MirrorChyanUploadToken }} os: win arch: x64 - - mirrorchyan_exe: - runs-on: macos-latest - steps: - - uses: MirrorChyan/uploading-action@v1 + - name: Upload Exe + uses: MirrorChyan/uploading-action@v1 with: - filetype: latest-release - filename: "BetterGI.Install.*.exe" - extra_zip: true + filetype: local mirrorchyan_rid: BGI - - github_token: ${{ secrets.GITHUB_TOKEN }} - owner: babalae - repo: better-genshin-impact + filename: "BetterGI.Install.zip" + version_name: ${{ steps.get-version.outputs.version }} upload_token: ${{ secrets.MirrorChyanUploadToken }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6c5a6199..6dd9c99b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -437,7 +437,6 @@ jobs: arch: x64 - name: Upload Install.exe - if: always() uses: MirrorChyan/uploading-action@v1 with: filetype: local