update gitea workflow;

This commit is contained in:
2025-11-04 17:39:31 +09:00
parent 49e1171781
commit fd1ed8793d
3 changed files with 17 additions and 15 deletions

View File

@@ -26,20 +26,23 @@ jobs:
- name: Pack all projects - name: Pack all projects
run: | run: |
set -e
for projfile in $(find . -name "*.csproj"); do for projfile in $(find . -name "*.csproj"); do
packable=$(dotnet msbuild "$projfile" -t:GetProperty -p:PropertyName=IsPackable -nologo -v:q) if grep -q "<IsPackable>true</IsPackable>" "$projfile"; then
if [ "$packable" = "true" ]; then echo "Packing $projfile..."
dotnet pack "$projfile" -c Release if ! dotnet pack "$projfile" -c Release -o ./artifacts; then
echo "⚠️ Failed to pack $projfile"
fi
fi fi
done done
- name: Publish all packages - name: Publish all packages
env: env:
NUGET_API_KEY: ${{ secrets.GITEA_TOKEN }} NUGET_API_KEY: ${{ secrets.NUGET_TOKEN }}
run: | run: |
for projfile in $(find . -name "*.csproj"); do for projfile in $(find . -name "*.csproj"); do
packable=$(dotnet msbuild "$projfile" -t:GetProperty -p:PropertyName=IsPackable -nologo -v:q) packable=$(dotnet msbuild "$projfile" -t:GetProperty -p:PropertyName=IsPackable -nologo -v:q)
if [ "$packable" = "true" ]; then if [ "$packable" = "True" ]; then
projname=$(basename "$projfile" .csproj) projname=$(basename "$projfile" .csproj)
VERSION=$(dotnet msbuild "$projfile" -nologo -v:q -t:GetProperty -p:PropertyName=PackageVersion) VERSION=$(dotnet msbuild "$projfile" -nologo -v:q -t:GetProperty -p:PropertyName=PackageVersion)
pkg=$(find "$projname/bin/Release" -maxdepth 1 -type f \ pkg=$(find "$projname/bin/Release" -maxdepth 1 -type f \

View File

@@ -1,4 +1,4 @@
using Misaki.HighPerformance.Image.Runtime; using Misaki.HighPerformance.Image.Runtime;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -45,8 +45,7 @@ public unsafe class ImageResult : IDisposable
} }
} }
internal static unsafe ImageResult FromResult(byte* result, uint width, uint height, ColorComponents comp, internal static unsafe ImageResult FromResult(byte* result, uint width, uint height, ColorComponents comp, ColorComponents req_comp)
ColorComponents req_comp)
{ {
if (result == null) if (result == null)
throw new InvalidOperationException(StbImage.stbi__g_failure_reason); throw new InvalidOperationException(StbImage.stbi__g_failure_reason);

View File

@@ -1,11 +1,11 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Misaki.HighPerformance.Image.Runtime; namespace Misaki.HighPerformance.Image.Runtime;
internal static unsafe class CRuntime internal static unsafe class CRuntime
{ {
private static readonly string numbers = "0123456789"; private static readonly string s_numbers = "0123456789";
public static void* malloc(ulong size) public static void* malloc(ulong size)
{ {
@@ -158,7 +158,7 @@ internal static unsafe class CRuntime
// First step - determine length // First step - determine length
var length = 0; var length = 0;
var ptr = start; var ptr = start;
while (numbers.IndexOf((char)*ptr) != -1) while (s_numbers.IndexOf((char)*ptr) != -1)
{ {
++ptr; ++ptr;
++length; ++length;
@@ -170,7 +170,7 @@ internal static unsafe class CRuntime
ptr = start; ptr = start;
while (length > 0) while (length > 0)
{ {
long num = numbers.IndexOf((char)*ptr); long num = s_numbers.IndexOf((char)*ptr);
var pow = (long)Math.Pow(10, length - 1); var pow = (long)Math.Pow(10, length - 1);
result += num * pow; result += num * pow;