Kaynağa Gözat

#62 packing nuget for both Debug and Release configurations

pull/63/head
Camille Galladjov 3 yıl önce
ebeveyn
işleme
da3d1161d8
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: C8DB6D39B1B47A0A
5 değiştirilmiş dosya ile 94 ekleme ve 20 silme
  1. +32
    -18
      .github/workflows/nuget-release.yml
  2. +24
    -0
      Makefile
  3. +9
    -2
      Svelto.ECS/Svelto.ECS.csproj
  4. +20
    -0
      Svelto.ECS/Svelto.ECS.nuspec
  5. +9
    -0
      Svelto.ECS/Svelto.ECS.targets

+ 32
- 18
.github/workflows/nuget-release.yml Dosyayı Görüntüle

@@ -30,36 +30,50 @@ jobs:
run: git clone https://github.com/Ujinjinjin/upm-preparator.git --branch v1.0.12 --single-branch

- name: create temp directory
run: mkdir temp
run: mkdir temp temp/com.sebaslab.svelto.common temp/com.sebaslab.svelto.ecs temp/bin temp/bin/debug temp/bin/release
- name: create solution file
run: dotnet new sln -n "${PKG_NAME}" -o temp/
# Svelto.Common
- name: create temp Svelto.Common directory
run: mkdir "temp/com.sebaslab.svelto.common"
# Prepare solution
- name: copy Svelto.Common files to temp directory
run: cp -r Svelto.Common/* "temp/com.sebaslab.svelto.common"
- name: add Svelto.Common to solution
run: dotnet sln "temp/${PKG_NAME}.sln" add "temp/com.sebaslab.svelto.common/Svelto.Common.csproj"
# Svelto.ECS
- name: get Svelto.ECS version
run: python3 upm-preparator/version.py --version-file "${ECS_VERSION_JSON}" --env-file "${GITHUB_ENV}"

- name: create temp Svelto.ECS directory
run: mkdir "temp/com.sebaslab.svelto.ecs"
- name: copy Svelto.ECS files to temp directory
run: cp -r Svelto.ECS/* "temp/com.sebaslab.svelto.ecs"
- name: add Svelto.Common to solution
run: dotnet sln "temp/${PKG_NAME}.sln" add "temp/com.sebaslab.svelto.common/Svelto.Common.csproj"
- name: add Svelto.ECS to solution
run: dotnet sln "temp/${PKG_NAME}.sln" add "temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj"
# Build for Debug
- name: create package for Debug configuration
run: dotnet pack /p:Version=1.0.0 -o temp/bin/debug temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Debug

- name: unzip debug nuget package
run: unzip temp/bin/debug/Svelto.ECS.1.0.0.nupkg -d temp/bin/debug

- name: copy debug DLL to temp folder
run: sudo cp temp/bin/debug/lib/netstandard2.0/Svelto.ECS.dll temp/bin/debug

# Build for Release
- name: create package for Release configuration
run: dotnet pack /p:Version=1.0.0 -o temp/bin/release temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Release

- name: unzip release nuget package
run: unzip temp/bin/release/Svelto.ECS.1.0.0.nupkg -d temp/bin/release

- name: copy release DLL to temp folder
run: sudo cp temp/bin/release/lib/netstandard2.0/Svelto.ECS.dll temp/bin/release

# Compile into nuget package
- name: get Svelto.ECS version
run: python3 upm-preparator/version.py --version-file "${ECS_VERSION_JSON}" --env-file "${GITHUB_ENV}"

- name: build nuget package
run: dotnet pack /p:Version=${PKG_VERSION} -o . "temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj"
run: sudo dotnet pack /p:PackageVersion=${PKG_VERSION} -o . temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Custom

- name: publish nuget package
run: dotnet nuget push ${{ env.PKG_NAME }}.${{ env.PKG_VERSION }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# - name: publish nuget package
# run: dotnet nuget push ${{ env.PKG_NAME }}.${{ env.PKG_VERSION }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

+ 24
- 0
Makefile Dosyayı Görüntüle

@@ -0,0 +1,24 @@
pkg_name := "Svelto.ECS"

nuget_pack:
make nuget_clean
mkdir temp temp/com.sebaslab.svelto.common temp/com.sebaslab.svelto.ecs temp/bin temp/bin/debug temp/bin/release
dotnet new sln -n ${pkg_name} -o temp/
cp -r Svelto.Common/* temp/com.sebaslab.svelto.common
cp -r Svelto.ECS/* temp/com.sebaslab.svelto.ecs
dotnet sln temp/${pkg_name}.sln add temp/com.sebaslab.svelto.common/Svelto.Common.csproj
dotnet sln temp/${pkg_name}.sln add temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj
# Build for Debug
dotnet pack /p:Version=1.0.0 -o temp/bin/debug temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Debug
unzip temp/bin/debug/Svelto.ECS.1.0.0.nupkg -d temp/bin/debug
cp temp/bin/debug/lib/netstandard2.0/Svelto.ECS.dll temp/bin/debug
# Build for Release
dotnet pack /p:Version=1.0.0 -o temp/bin/release temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Release
unzip temp/bin/release/Svelto.ECS.1.0.0.nupkg -d temp/bin/release
cp temp/bin/release/lib/netstandard2.0/Svelto.ECS.dll temp/bin/release
# Compile into nuget
dotnet pack /p:PackageVersion=2.0.0 -o . temp/com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Custom
make nuget_clean

nuget_clean:
rm -rf upm-preparator temp

+ 9
- 2
Svelto.ECS/Svelto.ECS.csproj Dosyayı Görüntüle

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Svelto.ECS</AssemblyName>
<LangVersion>7.3</LangVersion>
@@ -7,7 +7,9 @@
<PropertyGroup>
<PackageId>Svelto.ECS</PackageId>
<Authors>sebas77</Authors>
<RepositoryUrl>https://github.com/sebas77/Svelto.ECS</RepositoryUrl>
<RepositoryUrl>https://github.com/sebas77/Svelto.ECS</RepositoryUrl>
<NuspecFile Condition="'$(Configuration)'=='Custom'">Svelto.ECS.nuspec</NuspecFile>
<NuspecProperties Condition="'$(Configuration)'=='Custom'">version=$(PackageVersion)</NuspecProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -19,6 +21,11 @@
<UseSharedCompilation>false</UseSharedCompilation>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Custom' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<UseSharedCompilation>false</UseSharedCompilation>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\com.sebaslab.svelto.common\Svelto.Common.csproj" />
</ItemGroup>


+ 20
- 0
Svelto.ECS/Svelto.ECS.nuspec Dosyayı Görüntüle

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Svelto.ECS</id>
<authors>sebas77</authors>
<version>$version$</version>
<description>C# Lightweight Data Oriented Entity Component System Framework</description>
<projectUrl>https://github.com/sebas77/Svelto.ECS</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/sebas77/Svelto.ECS/master/LICENSE</licenseUrl>
<repository type="git" url="https://github.com/sebas77/Svelto.ECS.git" />
<dependencies>
<group targetFramework="netstandard2.0" />
</dependencies>
</metadata>
<files>
<file src="Svelto.ECS.targets" target="build/" />
<file src="../bin/debug/Svelto.ECS.dll" target="lib/Debug/netstandard2.0/" />
<file src="../bin/release/Svelto.ECS.dll" target="lib/Release/netstandard2.0/" />
</files>
</package>

+ 9
- 0
Svelto.ECS/Svelto.ECS.targets Dosyayı Görüntüle

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Reference Include="Svelto.ECS">
<HintPath Condition="'$(Optimize)'!='false'">$(MSBuildThisFileDirectory)../lib/Release/netstandard2.0/Svelto.ECS.dll</HintPath>
<HintPath Condition="'$(Optimize)'=='false'">$(MSBuildThisFileDirectory)../lib/Debug/netstandard2.0/Svelto.ECS.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

Yükleniyor…
İptal
Kaydet