Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions .github/workflows/packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@ jobs:
# 构造程序
- name: Build Packer if not cached
if: steps.cache-packer.outputs.cache-hit != 'true'
run: dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64 -p:PublishSingleFile=true
run: dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64

# build-uploader:
# if: github.repository == 'CFPAOrg/Minecraft-Mod-Language-Package'
# name: Build / Cache Uploader
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 1
# sparse-checkout: src
build-uploader:
if: github.repository == 'CFPAOrg/Minecraft-Mod-Language-Package'
name: Build / Cache Uploader
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: src

# # 缓存程序。一方面,在不同job之间需要这么做;另一方面,大约可以改善运行时间?
# # actions/cache的逻辑会在job末尾缓存打包程序;如果不命中,就自行构造程序。
# - name: Cache Uploader
# id: cache-uploader
# uses: actions/cache@v4
# with:
# key: ${{ runner.os }}-Uploader-${{ hashFiles('src/Uploader/**') }}
# path: Uploader.exe
# lookup-only: true
# 缓存程序。一方面,在不同job之间需要这么做;另一方面,大约可以改善运行时间?
# actions/cache的逻辑会在job末尾缓存打包程序;如果不命中,就自行构造程序。
- name: Cache Uploader
id: cache-uploader
uses: actions/cache@v4
with:
key: ${{ runner.os }}-Uploader-${{ hashFiles('src/Uploader/**') }}
path: Uploader.exe
lookup-only: true

# # 构造程序
# - name: Build Uploader if not cached
# if: steps.cache-uploader.outputs.cache-hit != 'true'
# run: dotnet publish .\src\Uploader\Uploader.csproj -o ./ -r win-x64 -p:PublishSingeFile=true
# 构造程序
- name: Build Uploader if not cached
if: steps.cache-uploader.outputs.cache-hit != 'true'
run: dotnet publish .\src\Uploader\Uploader.csproj -o ./ -r win-x64

initialize-release:
name: Initialize Release
Expand Down Expand Up @@ -284,17 +284,17 @@ jobs:
upload:
if: github.repository == 'CFPAOrg/Minecraft-Mod-Language-Package'
name: Upload Resource Packs to Remote Server
needs: [ pack ] # 显然,需要打包完成,并且存在上传程序,才可以上传给分发服务器
needs: [ pack, build-uploader ] # 显然,需要打包完成,并且存在上传程序,才可以上传给分发服务器
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Restore Uploader
id: cache-restore
uses: actions/cache/restore@v4
with:
fetch-depth: 1
sparse-checkout: src

# 构造程序
- name: Build Uploader
run: dotnet publish .\src\Uploader\Uploader.csproj -o ./ -r win-x64 -p:PublishSingeFile=true
key: ${{ runner.os }}-Packer-${{ hashFiles('src/Uploader/**') }}
path: |
Uploader.exe
fail-on-cache-miss: true # 前一步理应构造过的。如果不命中,肯定有问题,不如直接挂掉。

# 还原artifact(资源包)
- name: Restore Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# 构造程序
- name: Build Packer if not cached
if: steps.cache-packer.outputs.cache-hit != 'true'
run: dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64 -p:PublishSingleFile=true
run: dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64


pack:
Expand Down
9 changes: 5 additions & 4 deletions src/Packer/Packer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<AnalysisLevel>none</AnalysisLevel>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="0.27.2" />
<PackageReference Include="Serilog" Version="2.12.1-dev-01635" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.1-dev-00901" />
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="System.CommandLine.DragonFruit" Version="0.3.0-alpha.21216.1" />
</ItemGroup>

Expand Down
9 changes: 5 additions & 4 deletions src/Uploader/Uploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Neon.SSH.NET" Version="2.2.0" />
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00839" />
<PackageReference Include="Neon.SSH.NET" Version="2.11.1" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="System.CommandLine.DragonFruit" Version="0.4.0-alpha.22272.1" />
</ItemGroup>

Expand Down
Loading