Skip to content

Commit

Permalink
(#2) update scripts [pack-all-force]
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Sep 26, 2024
1 parent e374064 commit fcdbdbd
Show file tree
Hide file tree
Showing 28 changed files with 6,342 additions and 2 deletions.
35 changes: 35 additions & 0 deletions src/Nuar.Host/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Nuar framework..."

cd src/Nuar.Host/src/Nuar.Host

echo "Restoring NuGet packages..."
dotnet restore

PACKAGE_VERSION="1.0.$GITHUB_RUN_NUMBER"
echo "Building and packing the Paralax library..."
dotnet pack -c release /p:PackageVersion=$PACKAGE_VERSION --no-restore -o ./nupkg

PACKAGE_PATH="./nupkg/Nuar.Host.$PACKAGE_VERSION.nupkg"

if [ -f "$PACKAGE_PATH" ]; then
echo "Checking if the package is already signed..."
if dotnet nuget verify "$PACKAGE_PATH" | grep -q 'Package is signed'; then
echo "Package is already signed, skipping signing."
else
echo "Signing the NuGet package..."
dotnet nuget sign "$PACKAGE_PATH" \
--certificate-path "$CERTIFICATE_PATH" \
--timestamper http://timestamp.digicert.com
fi

echo "Uploading Nuar.Host package to NuGet..."
dotnet nuget push "$PACKAGE_PATH" -k "$NUGET_API_KEY" \
-s https://api.nuget.org/v3/index.json --skip-duplicate
echo "Package uploaded to NuGet."
else
echo "Error: Package $PACKAGE_PATH not found."
exit 1
fi
14 changes: 14 additions & 0 deletions src/Nuar.Host/src/Nuar.Host/Nuar.Host.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="3.1.0" />
<PackageReference Include="Nuar" Version="1.0.5" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions src/Nuar.Host/src/Nuar.Host/Nuar.Host.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nuar.Host", "Nuar.Host.csproj", "{05C3147D-F8B7-4C73-80F5-CE6866D90ECD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{05C3147D-F8B7-4C73-80F5-CE6866D90ECD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05C3147D-F8B7-4C73-80F5-CE6866D90ECD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05C3147D-F8B7-4C73-80F5-CE6866D90ECD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05C3147D-F8B7-4C73-80F5-CE6866D90ECD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {589BB9B3-EB14-4121-9C0C-3D7ED41DD7D8}
EndGlobalSection
EndGlobal
29 changes: 29 additions & 0 deletions src/Nuar.Host/src/Nuar.Host/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

namespace Nuar.Host
{
[ExcludeFromCodeCoverage]
public static class Program
{
public static Task Main(string[] args)
=> CreateHostBuilder(args).Build().RunAsync();

public static IHostBuilder CreateHostBuilder(string[] args) =>
Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.ConfigureAppConfiguration(builder =>
{
var configPath = args?.FirstOrDefault() ?? "nuar.yml";
builder.AddYamlFile(configPath, false);
})
.ConfigureServices(services => services.AddNuar())
.Configure(app => app.UseNuar());
});
}
}
Loading

0 comments on commit fcdbdbd

Please sign in to comment.