add torch assemblies

This commit is contained in:
zznty
2022-10-08 00:58:03 +07:00
parent 89c38764ad
commit 6a77bb5f94
3 changed files with 59 additions and 0 deletions

32
.github/workflows/torch.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Torch Server Package
on:
workflow_dispatch:
permissions:
packages: write
jobs:
Main:
name: Build Nuget Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Download Dlls
run: mkdir torch && wget --content-disposition --trust-server-names -i torch_dlls_list.txt -P torch/
- name: Fix Torch.Server extension
run: mv torch/Torch.Server.exe torch/Torch.Server.dll
- name: Prepare folder structure
run: mkdir -p ./nuget/lib/net48
- name: Copy binaries
run: cp ./torch/* ./nuget/lib/net48
- name: Get Torch version
id: torch_version
run: echo "::set-output name=version::1.3.1.$(wget -qO- https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/buildNumber)-master"
- name: Create Nuget Package
run: nuget pack specs/Torch.Server.ReferenceAssemblies.nuspec -BasePath ./nuget -Version ${{ inputs.version }} -NonInteractive -NoPackageAnalysis -OutputFileNamesWithoutVersion
- name: Push Nuget Package
run: dotnet nuget push ./Torch.Server.ReferenceAssemblies.nupkg --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Torch.Server.ReferenceAssemblies</id>
<version>1.0.1</version>
<title>Torch Server Reference Assemblies</title>
<authors>zznty</authors>
<owners>zznty</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Torch Server Reference Assemblies</description>
<repository type="git" url="https://github.com/PveTeam/se-torch-nuget" />
<dependencies>
<group targetFramework=".NETFramework4.8">
<dependency id="SpaceEngineersDedicated.ReferenceAssemblies" version="1.201.13" />
<dependency id="NLog" version="4.4.12" />
<dependency id="Newtonsoft.Json" version="12.0.2" />
</group>
</dependencies>
</metadata>
</package>

7
torch_dlls_list.txt Normal file
View File

@@ -0,0 +1,7 @@

https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/artifact/bin/x64/Release/Torch.API.dll
https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/artifact/bin/x64/Release/Torch.dll
https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/artifact/bin/x64/Release/Torch.Server.exe
https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/artifact/bin/x64/Release/Torch.API.xml
https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/artifact/bin/x64/Release/Torch.xml
https://build.torchapi.com/job/Torch/job/master/lastSuccessfulBuild/artifact/bin/x64/Release/Torch.Server.xml