12 Commits

19 changed files with 189 additions and 71 deletions
+7
View File
@@ -2,6 +2,12 @@ name: Build
run-name: Building with docker container.
on:
workflow_dispatch:
inputs:
version_suffix:
description: "Optional version suffix."
required: false
type: string
default: -rc.1
push:
tags:
- '*'
@@ -15,6 +21,7 @@ jobs:
REFUEL_API_KEY: "${{secrets.REFUEL_API_KEY}}"
NUGET_USER_NAME: "${{vars.NUGET_USER_NAME}}"
NUGET_INDEX: "${{vars.NUGET_INDEX}}"
VersionSuffix: "${{inputs.version_suffix}}"
volumes:
- ${{ gitea.workspace }}:/home/refuel/src
steps:
+2
View File
@@ -1,6 +1,8 @@
[submodule "stb"]
path = stb
url = https://github.com/nothings/stb.git
branch = master
[submodule "docker-cross-compiler"]
path = docker-cross-compiler
url = https://git.mixedup.dev/ReFuel/docker-cross-compiler
branch = stable
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(rf_stbi LANGUAGES C VERSION 1.0)
@@ -9,7 +9,6 @@
</PropertyGroup>
<ItemGroup>
<!-- <ProjectReference Include="..\ReFuel.StbImage\ReFuel.StbImage.csproj" /> -->
<PackageReference Include="ReFuel.StbImage" Version="2.1.0"/>
<PackageReference Include="OpenTK" Version="4.9.4" />
<EmbeddedResource Include="../rf_stbimage.png" LogicalName="default.png"/>
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=linux-arm;dllname=libstbi.so</NuspecProperties>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=linux-arm64;dllname=libstbi.so</NuspecProperties>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=linux-x64;dllname=libstbi.so</NuspecProperties>
</PropertyGroup>
</Project>
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=osx-arm64;dllname=libstbi.dylib</NuspecProperties>
</PropertyGroup>
</Project>
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=osx-x64;dllname=libstbi.dylib</NuspecProperties>
</PropertyGroup>
</Project>
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=win-x64;dllname=libstbi.dll</NuspecProperties>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<!-- Nuget Properties. -->
<Version>1.0.0$(VersionSuffix)</Version>
<PackageReleaseNotes>* Initial release.</PackageReleaseNotes>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile>../etc/native.nuspec</NuspecFile>
<NuspecProperties>version=$(Version);rid=win-x86;dllname=libstbi.dll</NuspecProperties>
</PropertyGroup>
</Project>
+15 -65
View File
@@ -1,32 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../etc/ReFuel.StbImage.Common.props"/>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<!-- <TargetFrameworks>net6.0;net8.0;net10.0</TargetFrameworks> -->
<RuntimeIdentifiers>linux-arm;linux-arm64;linux-x64;win-x86;win-x64;osx-arm64;osx-x64</RuntimeIdentifiers>
<RootNamespace>ReFuel.Stb</RootNamespace>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup>
<!-- Nuget Properties. -->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>ReFuel.StbImage</PackageId>
<Version>2.1.0</Version>
<Authors>STBI Authors, H. Utku Maden</Authors>
<Version>2.1.1$(VersionSuffix)</Version>
<Description>
A C# wrapper for the ubiquitous stb_image.h and stb_image_write.h library.
</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>images\icon.png</PackageIcon>
<PackageProjectUrl>https://refuel.mixedup.dev/docs/ReFuel.StbImage.html</PackageProjectUrl>
<RepositoryUrl>https://git.mixedup.dev/ReFuel/ReFuel.StbImage</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>stb; stb_image; stbi; image; load; save; read; write</PackageTags>
<PackageReleaseNotes># 2.1.0 (ABI BRAKING)
<PackageReleaseNotes>
# 2.1.1
* Move redistributables to their own packages which can be updated incrementally as required.
# 2.1.0 (ABI BRAKING)
* Fixed calling convention of unmanaged function pointers. (Thanks NogginBops!)
* Modified StbiStreamWrapper in order to fixed backing delegates of function pointers from being prematurely collected
by release mode JIT and the GC. StbiStreamWrapper.Callbacks is now a readonly field. (ABI BREAKING)
@@ -39,55 +30,14 @@
* Moved native function calls to ReFuel.Stb.Native</PackageReleaseNotes>
</PropertyGroup>
<!--
Because the .net build system is garbage of the purest quality, I need
to specify each runtime directory by itself or it won't be picked up as a
native specific to each platform and won't be included in the deps.json file
that determines a lot of load paths for projects.
-->
<ItemGroup>
<Content Include="*.md" Pack="true" PackagePath="/" />
<None Include="rf_stbimage.png" Pack="true" PackagePath="images\icon.png" />
<Content Include="runtimes/linux-arm/native/*.so">
<PackagePath>runtimes/linux-arm/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/linux-arm64/native/*.so">
<PackagePath>runtimes/linux-arm64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/linux-x64/native/*.so">
<PackagePath>runtimes/linux-x64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/linux-x86/native/*.so">
<PackagePath>runtimes/linux-x86/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/win-x64/native/*.dll">
<PackagePath>runtimes/win-x64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/win-x86/native/*.dll">
<PackagePath>runtimes/win-x86/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/osx-x64/native/*.dylib">
<PackagePath>runtimes/osx-x64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes/osx-arm64/native/*.dylib">
<PackagePath>runtimes/osx-arm64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<PackageReference Include="ReFuel.StbImage.redis.linux-arm" Version="1.0.*"/>
<PackageReference Include="ReFuel.StbImage.redis.linux-arm64" Version="1.0.*"/>
<PackageReference Include="ReFuel.StbImage.redis.linux-x64" Version="1.0.*"/>
<PackageReference Include="ReFuel.StbImage.redis.osx-arm64" Version="1.0.*"/>
<PackageReference Include="ReFuel.StbImage.redis.osx-x64" Version="1.0.*"/>
<PackageReference Include="ReFuel.StbImage.redis.win-x64" Version="1.0.*"/>
<PackageReference Include="ReFuel.StbImage.redis.win-x86" Version="1.0.*"/>
</ItemGroup>
</Project>
View File
+16 -1
View File
@@ -1,4 +1,19 @@
#!/bin/bash
cd $(dirname "$0")
./docker-cross-compiler/sh/build_native.sh .
# Add the local directory as a .NET package source.
dotnet nuget add source -n ReFuel.StbImage $PWD/bin
# Build each architecture in its own subfolder.
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD linux-arm64
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD linux-arm
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD linux-x64
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD osx-arm64
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD osx-x64
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD win-x64
DST=$PWD ./docker-cross-compiler/sh/build_native.sh $PWD win-x86
for d in ReFuel.StbImage.redis*; do
dotnet pack "$d"
done
dotnet build -c Release
+30
View File
@@ -0,0 +1,30 @@
<Project>
<PropertyGroup>
<!--Properties for packages.-->
<TargetFrameworks>net6.0;net8.0;net10.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<RootNamespace>ReFuel.Stb</RootNamespace>
<Optimize>true</Optimize>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageOutputPath>$(MSBuildThisFileDirectory)../bin</PackageOutputPath>
<!--Supresses warnings for the nuget packages with only native assemlies.-->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<Authors>STBI Authors, H. Utku Maden</Authors>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>images\icon.png</PackageIcon>
<PackageProjectUrl>https://refuel.mixedup.dev/docs/ReFuel.StbImage.html</PackageProjectUrl>
<RepositoryUrl>https://github.com/ReFuelGameEngine/ReFuel.StbImage</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>stb; stb_image; stbi; image; load; save; read; write</PackageTags>
</PropertyGroup>
<ItemGroup>
<Content Include="../*.md" Pack="true" PackagePath="/" />
<None Include="../rf_stbimage.png" Pack="true" PackagePath="images\icon.png" />
</ItemGroup>
</Project>
+20
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>ReFuel.StbImage.redis.$rid$</id>
<version>$version$</version>
<authors>STB Authors, H. Utku Maden</authors>
<license type="expression">MIT</license>
<readme>README.md</readme>
<icon>images\icon.png</icon>
<description>Native dependencies for ReFuel.StbImage</description>
<repository type="git" url="https://github.com/ReFuelGameEngine/ReFuel.StbImage" />
</metadata>
<files>
<file src="..\runtimes\$rid$\native\$dllname$" target="runtimes\$rid$\native\$dllname$" />
<file src="..\README.md" target="README.md"/>
<file src="..\LICENSE.md" target="LICENSE.md"/>
<file src="..\rf_stbimage.png" target="images\icon.png"/>
</files>
</package>
+1 -1
View File
@@ -24,4 +24,4 @@ dotnet nuget add source \
-n ReFuel -u "$NUGET_USER_NAME" -p "$REFUEL_API_KEY" \
--store-password-in-clear-text \
"$NUGET_INDEX"
dotnet nuget push -s ReFuel bin/*/*.nupkg
dotnet nuget push -s ReFuel bin/*.nupkg
+1 -1
Submodule stb updated: f7f20f39fe...31c1ad3745