88 - ' src/**'
99 - ' config/packer/**'
1010 - ' projects/**'
11+ - ' .github/workflows/packer.yml'
1112
1213
1314jobs :
@@ -28,14 +29,15 @@ jobs:
2829 with :
2930 key : ${{ runner.os }}-Packer-${{ hashFiles('src/Packer/**') }}
3031 path : |
31- Packer.exe
32- git2-*.dll
32+ build/ Packer.exe
33+ build/ git2-*.dll
3334 lookup-only : true
3435
3536 # 构造程序
3637 - name : Build Packer if not cached
3738 if : steps.cache-packer.outputs.cache-hit != 'true'
38- run : dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64
39+ # dotnet/sdk#51806 Console Projects fail to compile with <ArtifactsPath>$(MSBuildThisFileDirectory)
40+ run : dotnet publish .\src\Packer\Packer.csproj -o ./build -r win-x64
3941
4042 build-uploader :
4143 if : github.repository == 'CFPAOrg/Minecraft-Mod-Language-Package'
@@ -54,13 +56,14 @@ jobs:
5456 uses : actions/cache@v4
5557 with :
5658 key : ${{ runner.os }}-Uploader-${{ hashFiles('src/Uploader/**') }}
57- path : Uploader.exe
59+ path : build/ Uploader.exe
5860 lookup-only : true
5961
6062 # 构造程序
6163 - name : Build Uploader if not cached
6264 if : steps.cache-uploader.outputs.cache-hit != 'true'
63- run : dotnet publish .\src\Uploader\Uploader.csproj -o ./ -r win-x64
65+ # dotnet/sdk#51806 Console Projects fail to compile with <ArtifactsPath>$(MSBuildThisFileDirectory)
66+ run : dotnet publish .\src\Uploader\Uploader.csproj -o ./build -r win-x64
6467
6568 pack :
6669 name : Pack Resources and Upload Artifacts/Releases
@@ -84,16 +87,21 @@ jobs:
8487 with :
8588 key : ${{ runner.os }}-Packer-${{ hashFiles('src/Packer/**') }}
8689 path : |
87- Packer.exe
88- git2-*.dll
90+ build/ Packer.exe
91+ build/ git2-*.dll
8992 fail-on-cache-miss : true # 应由前序保证
9093
94+ # dotnet/sdk#51806 Console Projects fail to compile with <ArtifactsPath>$(MSBuildThisFileDirectory)
95+ - run : mv ./build/* .
96+ shell : bash
97+
9198 - name : Check changed path on ${{ matrix.version }}
9299 uses : MarceloPrado/has-changed-path@v1.0
93100 id : check-changes
94101 with :
95102 # 判断位置:该版本文件、该版本配置、代码
96103 paths : >
104+ .github/workflows/packer.yml
97105 projects/${{ matrix.version }}
98106 config/packer/${{ matrix.version }}.json
99107 src/**
@@ -133,9 +141,13 @@ jobs:
133141 with :
134142 key : ${{ runner.os }}-Uploader-${{ hashFiles('src/Uploader/**') }}
135143 path : |
136- Uploader.exe
144+ build/ Uploader.exe
137145 fail-on-cache-miss : true # 应由前序保证
138146
147+ # dotnet/sdk#51806 Console Projects fail to compile with <ArtifactsPath>$(MSBuildThisFileDirectory)
148+ - run : mv ./build/* .
149+ shell : bash
150+
139151 # 还原artifact(资源包)
140152 - name : Restore Artifacts
141153 uses : actions/download-artifact@v4
0 commit comments