Skip to content

Commit

Permalink
Update .NET Core version to 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartdohmann committed Feb 16, 2024
1 parent d975d58 commit a4f27c4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 11 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/ci-dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,53 @@ on:
options:
- production
- staging
- develop
default: "production"

env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && secrets.CLIENT_SECRET || secrets.STAGING_CLIENT_SECRET }}
VAAS_URL: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && 'wss://gateway.production.vaas.gdatasecurity.de' || 'wss://gateway.staging.vaas.gdatasecurity.de' }}
TOKEN_URL: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && 'https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token' || 'https://account-staging.gdata.de/realms/vaas-staging/protocol/openid-connect/token' }}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
VAAS_URL: 'wss://gateway.production.vaas.gdatasecurity.de'
TOKEN_URL: 'https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token'
VAAS_CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
VAAS_USER_NAME: ${{ secrets.VAAS_USER_NAME }}
VAAS_PASSWORD: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && secrets.VAAS_PASSWORD || secrets.STAGING_VAAS_PASSWORD }}
VAAS_PASSWORD: ${{secrets.VAAS_PASSWORD}}

jobs:
build-dotnet:
name: Build & Test C# SDK
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["6.0.x"]
dotnet-version: ["8.0.x"]

steps:
- uses: actions/checkout@v3

- name: set staging environment
if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/java') && endsWith(github.ref, '-beta')))
run: |
echo "CLIENT_ID=${{ secrets.STAGING_CLIENT_ID }}" >> $GITHUB_ENV
echo "CLIENT_SECRET=${{ secrets.STAGING_CLIENT_SECRET }}" >> $GITHUB_ENV
echo "VAAS_URL=wss://gateway.staging.vaas.gdatasecurity.de" >> $GITHUB_ENV
echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-staging/protocol/openid-connect/token" >> $GITHUB_ENV
echo "VAAS_CLIENT_ID=${{ secrets.STAGING_VAAS_CLIENT_ID }}" >> $GITHUB_ENV
echo "VAAS_USER_NAME=${{ secrets.STAGING_VAAS_USER_NAME }}" >> $GITHUB_ENV
echo "VAAS_PASSWORD=${{ secrets.STAGING_VAAS_PASSWORD }}" >> $GITHUB_ENV
- name: set develop environment
if: (inputs.environment == 'develop' || (startsWith(github.ref, 'refs/tags/java') && endsWith(github.ref, '-alpha')))
run: |
echo "CLIENT_ID=${{ secrets.DEVELOP_CLIENT_ID }}" >> $GITHUB_ENV
echo "CLIENT_SECRET=${{ secrets.DEVELOP_CLIENT_SECRET }}" >> $GITHUB_ENV
echo "VAAS_URL=wss://gateway.develop.vaas.gdatasecurity.de" >> $GITHUB_ENV
echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-develop/protocol/openid-connect/token" >> $GITHUB_ENV
echo "VAAS_CLIENT_ID=${{ secrets.DEVELOP_VAAS_CLIENT_ID }}" >> $GITHUB_ENV
echo "VAAS_USER_NAME=${{ secrets.DEVELOP_VAAS_USER_NAME }}" >> $GITHUB_ENV
echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}

Expand Down
2 changes: 1 addition & 1 deletion dotnet/Vaas/src/Vaas/Vaas.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Version>0.0.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Authors>[email protected]</Authors>
<Company>G DATA CyberDefense AG</Company>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/Vaas/test/TestFiles/TestFiles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/Vaas/test/Vaas.Test/Vaas.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions dotnet/Vaas/test/Vaas.Test/VaasTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public async Task ForSha256Async_SendsUserAgent()
[Fact]
public void Constructor_IfRelativeUrl_ThrowsVaasClientException()
{
var e = Assert.Throws<ArgumentException>(() =>
var e = Assert.Throws<UriFormatException>(() =>
new Vaas(_httpClient, _authenticator.Object, new VaasOptions() { Url = new Uri("/relative") }));
Assert.Equal(
"Parameter \"options.Url.Host\" (string) must not be null or whitespace, was whitespace. (Parameter 'options.Url.Host')",
"Invalid URI: The format of the URI could not be determined.",
e.Message);
}

Expand Down

0 comments on commit a4f27c4

Please sign in to comment.