Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74c6cb6027 | ||
|
|
98ec9ae231 | ||
|
|
18d2dfb86e | ||
|
|
ef3f1bfa88 | ||
|
|
01a2689549 | ||
|
|
916f046789 | ||
|
|
51ac170a22 |
@@ -1,21 +0,0 @@
|
|||||||
name: PublishNugetPackage
|
|
||||||
|
|
||||||
on: [create]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
name: Publish Project to Nuget
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Setup .NET Core
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
|
||||||
dotnet-version: '5.0.100'
|
|
||||||
- name: Publish
|
|
||||||
run: |
|
|
||||||
version=`git describe --tags`
|
|
||||||
dotnet build --configuration release -p:PackageVersion=$version
|
|
||||||
dotnet nuget push bin/release/Simcu.SimApi.$version.nupkg -k ${NUGET_APIKEY} -s https://www.nuget.org/api/v2/package
|
|
||||||
env:
|
|
||||||
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
name: PublishNugetPackage
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish Project to Nuget
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Setup .NET Core
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: "6.0.100"
|
||||||
|
- name: Publish
|
||||||
|
run: |
|
||||||
|
version=`git describe --tags`
|
||||||
|
dotnet build --configuration release -p:PackageVersion=$version
|
||||||
|
dotnet nuget push bin/release/Simcu.SimApi.$version.nupkg -k ${NUGET_APIKEY} -s https://www.nuget.org/api/v2/package
|
||||||
|
env:
|
||||||
|
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
|
||||||
@@ -55,6 +55,19 @@ namespace SimApi.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetUploadUrl(string path, int expire = 7200)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Mc.PresignedPutObjectAsync(Bucket, path, expire).Result;
|
||||||
|
}
|
||||||
|
catch (MinioException e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Error occurred: " + e);
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string UploadFile(string path, Stream stream)
|
public string UploadFile(string path, Stream stream)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
+2
-10
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Security.Cryptography;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ namespace SimApi.Helpers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool CheckCell(string cell)
|
public static bool CheckCell(string cell)
|
||||||
{
|
{
|
||||||
var regex = new Regex("^1[34578]\\d{9}$");
|
var regex = new Regex("^1[3456789]\\d{9}$");
|
||||||
return regex.IsMatch(cell);
|
return regex.IsMatch(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,12 +36,5 @@ namespace SimApi.Helpers
|
|||||||
|
|
||||||
return strbul.ToString();
|
return strbul.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Log(string message, string type = "Information")
|
|
||||||
{
|
|
||||||
Console.WriteLine($"[ SimApi ][ {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff")} ][ {type} ]");
|
|
||||||
Console.WriteLine(message);
|
|
||||||
Console.WriteLine("");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -14,7 +14,7 @@
|
|||||||
<SynchReleaseVersion>false</SynchReleaseVersion>
|
<SynchReleaseVersion>false</SynchReleaseVersion>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<PackageVersion>5.0.2</PackageVersion>
|
<PackageVersion>5.0.2</PackageVersion>
|
||||||
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'YYApi' " />
|
<PropertyGroup Condition=" '$(RunConfiguration)' == 'YYApi' " />
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Minio" Version="3.1.13" />
|
<PackageReference Include="Minio" Version="3.1.13" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.4" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.2.3" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.1.4" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.2.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<MonoDevelop>
|
<MonoDevelop>
|
||||||
|
|||||||
+1
-1
@@ -175,7 +175,7 @@ namespace SimApi
|
|||||||
builder.ApplicationServices.GetService<ILoggerFactory>().AddProvider(new SimApiLoggerProvider());
|
builder.ApplicationServices.GetService<ILoggerFactory>().AddProvider(new SimApiLoggerProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
var logger = builder.ApplicationServices.GetService<ILogger>();
|
var logger = builder.ApplicationServices.GetService<ILogger<SimApiLogger>>();
|
||||||
|
|
||||||
if (options.EnableForwardHeaders)
|
if (options.EnableForwardHeaders)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user