try and trigger the workflow_dispatch event

This commit is contained in:
Paul Schneider
2025-06-11 14:28:00 +01:00
parent 836dae756f
commit 4c1235267c
5 changed files with 58 additions and 31 deletions

View File

@ -4,12 +4,43 @@
name: .NET
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: true
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
log-the-inputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Log level: $LEVEL"
echo "Tags: $TAGS"
echo "Environment: $ENVIRONMENT"
env:
LEVEL: ${{ inputs.logLevel }}
TAGS: ${{ inputs.tags }}
ENVIRONMENT: ${{ inputs.environment }}
build:
runs-on: ubuntu-latest

7
.vscode/launch.json vendored
View File

@ -5,6 +5,7 @@
"version": "0.2.0",
"configurations": [
/* {
"name": ".NET Core Launch (web-client)",
"type": "coreclr",
@ -36,11 +37,12 @@
"stopAtEntry": false,
"console": "internalConsole"
},
*/
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-web",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Yavsc/bin/Debug/net8.0/Yavsc.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Yavsc",
@ -55,8 +57,7 @@
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},*/
},
{
"name": "webApi",
"type": "dotnet",

View File

@ -1,21 +0,0 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:35792ea4ad1db051981f62b313f1be3b46b1f45cadbaa3c288cd0d3056eefb83 AS build
WORKDIR /workdir
# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out src/Yavsc/Yavsc.csproj
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0@sha256:6c4df091e4e531bb93bdbfe7e7f0998e7ced344f54426b7e874116a3dc3233ff
WORKDIR /workdir
COPY --from=build /workdir/out .
ENV ASPNETCORE_ENVIRONMENT=lua
EXPOSE 85/TCP
EXPOSE 86/TCP
ENTRYPOINT ["dotnet", "Yavsc.dll"]

View File

@ -1,6 +1,7 @@
CONFIG=Debug
FRAMEWORK=net8.0
DESTDIR=/tmp/yavsc
clean:
dotnet clean
@ -23,4 +24,12 @@ src/Yavsc.Server/bin/$(CONFIG)/$(FRAMEWORK)/Yavsc.Server.dll:
src/Yavsc/bin/$(CONFIG)/$(FRAMEWORK)/Yavsc.dll:
dotnet build -p:Configuration=$(CONFIG) --project src/Yavsc/Yavsc.csproj
publish:
dotnet publish src/Yavsc/Yavsc.csproj -c Release -o $(DESTDIR)/srv/www/yavsc
install: publish
chown -R www-data $(DESTDIR)/srv/www/yavsc
chgrp -R www-data $(DESTDIR)/srv/www/yavsc
.PHONY:

View File

@ -30,6 +30,8 @@ using Yavsc.Services;
using Yavsc.Settings;
using Yavsc.ViewModels.Auth;
using Yavsc.Server.Helpers;
using System.Security.Cryptography;
using Microsoft.IdentityModel.Tokens;
namespace Yavsc.Extensions;
@ -300,13 +302,18 @@ public static class HostingExtensions
}
else
{
var path = builder.Configuration["Kestrel:Endpoints:Https:KeyPath"];
var pass = builder.Configuration["Kestrel:Endpoints:Https:Password"];
var path = builder.Configuration["SigningCert:Path"];
var pass = builder.Configuration["SigningCert:Password"];
Debug.Assert(path != null);
FileInfo certFileInfo = new FileInfo(path);
Debug.Assert(certFileInfo.Exists);
var cert = new X509Certificate2(path, pass);
identityServerBuilder.AddSigningCredential(cert);
RSA rsa = RSA.Create();
rsa.ImportFromPem(File.ReadAllText(certFileInfo.FullName));
var signingCredentials = new SigningCredentials(new RsaSecurityKey(rsa), SecurityAlgorithms.RsaSha256)
{
CryptoProviderFactory = new CryptoProviderFactory { CacheSignatureProviders = false }
};
identityServerBuilder.AddSigningCredential(signingCredentials);
}
return identityServerBuilder;
}