Skip to content

Commit cef95ba

Browse files
authored
Feat:优化 Actions 文件 (PCL-Community#219)
1 parent 7da5208 commit cef95ba

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/build.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,47 @@ jobs:
1818
matrix:
1919
configuration: [Beta, Release]
2020
steps:
21+
2122
- name: Checkout
2223
uses: actions/checkout@v4
2324
with:
2425
fetch-depth: 0
26+
2527
- name: Set Describe
2628
shell: bash
2729
run: |
2830
describe=`git describe --tags --always`
2931
echo "describe=$describe" >> $GITHUB_ENV
32+
3033
- name: Restore NuGet Packages
3134
run: nuget restore "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -PackagesDirectory "packages"
35+
3236
- name: Setup MSBuild.exe
3337
uses: microsoft/setup-msbuild@v2
3438
with:
3539
msbuild-architecture: x64
40+
41+
- name: Update Help
42+
run: |
43+
Set-Location ..
44+
git clone https://github.com/LTCatt/PCL2Help.git -b master --single-branch --depth 1
45+
Set-Location PCL2Help
46+
Remove-Item -Path *.* -Recurse -Force
47+
Compress-Archive -Path .\* -DestinationPath .\Help.zip
48+
Copy-Item -Path .\Help.zip -Destination "..\PCL2-CE\Plain Craft Launcher 2\Resources\Help.zip" -Force
49+
Set-Location ..\PCL2-CE
50+
51+
3652
- name: Replace
3753
run: |
3854
(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"
3955
(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"
4056
(gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const LittleSkinClientId As String = ""', 'Public Const LittleSkinClientId As String = "${{ secrets.LITTLESKIN_CLIENT_ID }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
4157
(gc "Plain Craft Launcher 2\Modules\Base\ModBase.vb") -replace 'Public Const CommitHash As String = "native"', 'Public Const CommitHash As String = "${{ github.sha }}"' | Out-File "Plain Craft Launcher 2\Modules\Base\ModBase.vb"
4258
(gc "Plain Craft Launcher 2\Pages\PageOther\PageOtherAbout.xaml") -replace 'https://github.com/PCL-Community/PCL2-CE', 'https://github.com/PCL-Community/PCL2-CE/tree/${{ github.sha }}' | Out-File "Plain Craft Launcher 2\Pages\PageOther\PageOtherAbout.xaml"
43-
rm "Plain Craft Launcher 2\Resources\Help.zip"
44-
aria2c "--out=Plain Craft Launcher 2\Resources\Help.zip" "https://codeload.github.com/LTCatt/PCL2Help/zip/refs/heads/master"
45-
7z x "Plain Craft Launcher 2\Resources\Help.zip" -o"Plain Craft Launcher 2\Resources"
46-
rm "Plain Craft Launcher 2\Resources\Help.zip"
47-
rm "Plain Craft Launcher 2\Resources\PCL2Help-master\*.*"
48-
7z a "Plain Craft Launcher 2\Resources\Help.zip" ".\Plain Craft Launcher 2\Resources\PCL2Help-master\*"
49-
rm "Plain Craft Launcher 2\Resources\PCL2Help-master\" -Recurse
5059
- name: Build
5160
run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ matrix.configuration }}
61+
5262
- name: Upload a Build Artifact
5363
uses: actions/upload-artifact@v4
5464
with:

0 commit comments

Comments
 (0)