From f8cbbf80922d5c898545ba4913346e102e191a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Thu, 6 Feb 2025 22:01:35 +0800 Subject: [PATCH 1/7] test --- .github/workflows/build.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf88c42..94630c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,22 +27,29 @@ jobs: run: | describe=`git describe --tags --always` echo "describe=$describe" >> $GITHUB_ENV + - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v2 with: msbuild-architecture: x64 + + - name: Update Help + run: | + Set-Location ../ + git clone https://github.com/LTCatt/PCL2Help.git -b master + Set-Location PCL2Help + Remove-Item -Path *.* -Recurse -Force + Compress-Archive -Path . -DestinationPath .\Help.zip -Confirm + Copy-Item -Path .\Help.zip -Destination "..\PCL2\Plain Craft Launcher 2\Resources\Help.zip" -Force + Set-Location ..\PCL2 + + - name: Replace run: | (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const OAuthClientId As String = ""', 'Public Const OAuthClientId As String = "${{ secrets.CLIENT_ID }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb" (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const CurseForgeAPIKey As String = ""', 'Public Const CurseForgeAPIKey As String = "${{ secrets.CURSEFORGE_API_KEY }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb" (gc "Plain Craft Launcher 2\Modules\Base\ModBase.vb") -replace 'Public Const CommitHash As String = ""', 'Public Const CommitHash As String = "${{ github.sha }}"' | Out-File "Plain Craft Launcher 2\Modules\Base\ModBase.vb" - rm "Plain Craft Launcher 2\Resources\Help.zip" - aria2c "--out=Plain Craft Launcher 2\Resources\Help.zip" "https://codeload.github.com/LTCatt/PCL2Help/zip/refs/heads/master" - 7z x "Plain Craft Launcher 2\Resources\Help.zip" -o"Plain Craft Launcher 2\Resources" - rm "Plain Craft Launcher 2\Resources\Help.zip" - rm "Plain Craft Launcher 2\Resources\PCL2Help-master\*.*" - 7z a "Plain Craft Launcher 2\Resources\Help.zip" ".\Plain Craft Launcher 2\Resources\PCL2Help-master\*" - rm "Plain Craft Launcher 2\Resources\PCL2Help-master\" -Recurse + - name: Build run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ matrix.configuration }} - name: Upload a Build Artifact From 4c1e9ccf7275ddd062ca23d14175bc0b190eb38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Thu, 6 Feb 2025 22:04:44 +0800 Subject: [PATCH 2/7] Fix bug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94630c5..9d20de6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: git clone https://github.com/LTCatt/PCL2Help.git -b master Set-Location PCL2Help Remove-Item -Path *.* -Recurse -Force - Compress-Archive -Path . -DestinationPath .\Help.zip -Confirm + Compress-Archive -Path .\* -DestinationPath .\Help.zip Copy-Item -Path .\Help.zip -Destination "..\PCL2\Plain Craft Launcher 2\Resources\Help.zip" -Force Set-Location ..\PCL2 From aa3e08a7fbf364afcf6334426e99f3b84d81b7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Thu, 6 Feb 2025 22:10:39 +0800 Subject: [PATCH 3/7] test --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d20de6..6086316 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,8 +35,8 @@ jobs: - name: Update Help run: | - Set-Location ../ - git clone https://github.com/LTCatt/PCL2Help.git -b master + Set-Location .. + git clone https://github.com/mqingxue/PCL2Help.git -b master Set-Location PCL2Help Remove-Item -Path *.* -Recurse -Force Compress-Archive -Path .\* -DestinationPath .\Help.zip From cde644c1e13e8779f4623f6c7abe355edb7e3cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Thu, 6 Feb 2025 22:22:43 +0800 Subject: [PATCH 4/7] done --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6086316..9d00aa6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Update Help run: | Set-Location .. - git clone https://github.com/mqingxue/PCL2Help.git -b master + git clone https://github.com/LTCatt/PCL2Help.git -b master Set-Location PCL2Help Remove-Item -Path *.* -Recurse -Force Compress-Archive -Path .\* -DestinationPath .\Help.zip From 4f2e20ff4eb55a20cbedaf9400d05bb8f06890b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Thu, 6 Feb 2025 22:35:00 +0800 Subject: [PATCH 5/7] Format Code --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d00aa6..6967090 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,14 @@ jobs: strategy: matrix: configuration: [Debug, Release] + steps: + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Set Describe shell: bash run: | @@ -52,6 +55,7 @@ jobs: - name: Build run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ matrix.configuration }} + - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: From df2cc61c2716f588d09f22b362f3220a0620201d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Thu, 6 Feb 2025 22:39:44 +0800 Subject: [PATCH 6/7] Add Description --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6967090..638bfeb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,12 +38,19 @@ jobs: - name: Update Help run: | + # 切换到上一级目录,免得混在一起 Set-Location .. + # 检出远程仓库的 master 分支 git clone https://github.com/LTCatt/PCL2Help.git -b master + # 切换到帮助库的目录 Set-Location PCL2Help + # 删掉无用的文件 Remove-Item -Path *.* -Recurse -Force + # 压缩 Compress-Archive -Path .\* -DestinationPath .\Help.zip + # 覆盖文件 Copy-Item -Path .\Help.zip -Destination "..\PCL2\Plain Craft Launcher 2\Resources\Help.zip" -Force + # 切换到原来的目录进行编译 Set-Location ..\PCL2 @@ -55,7 +62,7 @@ jobs: - name: Build run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ matrix.configuration }} - + - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: From e48f39ef5b5eaeb7cb0d2ea72482ca544a8bb07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E8=BD=BB=E9=9B=AA?= <3894593384@qq.com> Date: Fri, 7 Feb 2025 13:19:34 +0800 Subject: [PATCH 7/7] Test --- .github/workflows/build.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 638bfeb..8a0e38e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,19 +38,12 @@ jobs: - name: Update Help run: | - # 切换到上一级目录,免得混在一起 Set-Location .. - # 检出远程仓库的 master 分支 - git clone https://github.com/LTCatt/PCL2Help.git -b master - # 切换到帮助库的目录 + git clone https://github.com/LTCatt/PCL2Help.git -b master --single-branch --depth 1 Set-Location PCL2Help - # 删掉无用的文件 Remove-Item -Path *.* -Recurse -Force - # 压缩 Compress-Archive -Path .\* -DestinationPath .\Help.zip - # 覆盖文件 Copy-Item -Path .\Help.zip -Destination "..\PCL2\Plain Craft Launcher 2\Resources\Help.zip" -Force - # 切换到原来的目录进行编译 Set-Location ..\PCL2