Skip to content

Commit

Permalink
Merge pull request #93 from difi/netstandard2.0
Browse files Browse the repository at this point in the history
Netstandard2.0 & felles avhengigheter
  • Loading branch information
johnksv authored Mar 1, 2021
2 parents e631ab9 + 1ddd47f commit dd67b7f
Show file tree
Hide file tree
Showing 58 changed files with 1,154 additions and 1,492 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build

on: [push]

jobs:
build:
name: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Print openssl version
run: |
openssl version
- name: Decrypt signing key to use for strong-name
env:
SIGNINGKEY_ENC_PASSWORD: ${{ secrets.signingkeyEncPassword }}
run: |
openssl aes-256-cbc -salt -pbkdf2 -k "$SIGNINGKEY_ENC_PASSWORD" -in signingkey.snk.enc -out signingkey.snk -d
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore

test:
name: test
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Print openssl version
run: |
openssl version
- name: Decrypt signing key to use for strong-name
env:
SIGNINGKEY_ENC_PASSWORD: ${{ secrets.signingkeyEncPassword }}
run: |
openssl aes-256-cbc -salt -pbkdf2 -k "$SIGNINGKEY_ENC_PASSWORD" -in signingkey.snk.enc -out signingkey.snk -d
- name: Install dependencies
run: dotnet restore
- name: echo Info
run: echo "Tests with certificates are skiped due to Unix LocalMachine X509Store is limited to the Root and CertificateAuthority stores."
- name: Test
run: dotnet test --no-restore --verbosity normal --filter Category!=testWithCert

52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Print openssl version
run: |
openssl version
- name: Decrypt signing key to use for strong-name
env:
SIGNINGKEY_ENC_PASSWORD: ${{ secrets.signingkeyEncPassword }}
run: |
openssl aes-256-cbc -salt -pbkdf2 -k "$SIGNINGKEY_ENC_PASSWORD" -in signingkey.snk.enc -out signingkey.snk -d
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Set assembly version to major semver
run: echo "ASSEMBLY_VERSION=$(echo ${GITHUB_REF:10} | cut -d '.' -f 1).0.0" >> $GITHUB_ENV
- name: Print assembly version
run: echo $ASSEMBLY_VERSION
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digdir/packed Difi.Oppslagstjeneste.Klient
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digdir/packed Difi.Oppslagstjeneste.Klient.Domene
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digdir/packed Difi.Oppslagstjeneste.Klient.Scripts
- name: Push Klient to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digdir/packed/difi-oppslagstjeneste-klient.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Domene to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digdir/packed/Difi.Oppslagstjeneste.Klient.Domene.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Scripts to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digdir/packed/Difi.Oppslagstjeneste.Klient.Scripts.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ logs
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.


# Visual Studio 2015/2017 cache/options directory
.vs/

# User-specific files
*.suo
Expand Down Expand Up @@ -131,10 +132,14 @@ pip-log.txt
# Generated content
combined*.css
*.js.map
Status API Training Shop Blog About © 2014 GitHub, Inc. Terms Privacy Security Contact
Status API Training Shop Blog About 2014 GitHub, Inc. Terms Privacy Security Contact

# NuGet Package files
*.nupkg

#Krypteringsnøkkel
*.pfx

# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
*.snk
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

161 changes: 60 additions & 101 deletions Difi.Oppslagstjeneste.Klient.Domene/Difi.Oppslagstjeneste.Klient.Domene.csproj
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,101 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3EC8D196-7BD8-4C88-B989-216801AD0840}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Difi.Oppslagstjeneste.Klient.Domene</RootNamespace>
<AssemblyName>Difi.Oppslagstjeneste.Klient.Domene</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Difi.Oppslagstjeneste.Klient.Domene.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>C:\Keys\signingkey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="ApiClientShared, Version=2.0.0.0, Culture=neutral, PublicKeyToken=6e6972f540d5419a, processorArchitecture=MSIL">
<HintPath>..\packages\api-client-shared.2.0.0\lib\net45\ApiClientShared.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Difi.Felles.Utility, Version=1.2.0.0, Culture=neutral, PublicKeyToken=6e6972f540d5419a, processorArchitecture=MSIL">
<HintPath>..\packages\difi-felles-utility-dotnet.1.2.0\lib\net45\Difi.Felles.Utility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionItems\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Entiteter\EndringsInfo.cs" />
<Compile Include="Entiteter\Enums\Informasjonsbehov.cs" />
<Compile Include="Entiteter\Enums\Status.cs" />
<Compile Include="Entiteter\Enums\Varslingsstatus.cs" />
<Compile Include="Entiteter\Epostadresse.cs" />
<Compile Include="Entiteter\Svar\EndringerSvar.cs" />
<Compile Include="Entiteter\Svar\PersonerSvar.cs" />
<Compile Include="Entiteter\Svar\PrintSertifikatSvar.cs" />
<Compile Include="Exceptions\OppslagstjenesteException.cs" />
<Compile Include="Exceptions\SikkerhetsException.cs" />
<Compile Include="Exceptions\SendException.cs" />
<Compile Include="Exceptions\SertifikatException.cs" />
<Compile Include="Exceptions\UventetFeilException.cs" />
<Compile Include="Exceptions\ValideringsException.cs" />
<Compile Include="Exceptions\XmlParseException.cs" />
<Compile Include="Entiteter\Kontaktinformasjon.cs" />
<Compile Include="Entiteter\Mobiltelefonnummer.cs" />
<Compile Include="Entiteter\Person.cs" />
<Compile Include="Extensions\EnumExtensions.cs" />
<Compile Include="Navnerom.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Entiteter\Sikkerdigitalpostadresse.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\difi-oppslagstjeneste.pfx">
<Link>Properties\difi-oppslagstjeneste.pfx</Link>
</None>
<None Include="App.config" />
<None Include="C:\Keys\signingkey.snk">
<Link>signingkey.snk</Link>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">

<PropertyGroup>
<Title>Difi Oppslagstjeneste Klient Domene</Title>
<PackageId>Difi.Oppslagstjeneste.Klient.Domene</PackageId>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\signingkey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Difi.Oppslagstjeneste.Klient.Domene</RootNamespace>
<ProjectGuid>{3EC8D196-7BD8-4C88-B989-216801AD0840}</ProjectGuid>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Difi.Felles.Utility.Resources" Version="5.0.1"/>
<PackageReference Include="Digipost.Api.Client.Shared" Version="7.0.1"/>
<PackageReference Include="Difi.Felles.Utility" Version="5.0.1"/>
</ItemGroup>

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Difi.Oppslagstjeneste.Klient.Domene</AssemblyName>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile/>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Difi.Oppslagstjeneste.Klient.Domene.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SolutionItems\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup/>
</Project>
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
using System.Security.Cryptography.X509Certificates;

namespace Difi.Oppslagstjeneste.Klient.Domene.Entiteter.Svar
{
/// <summary>
/// Svar fra Oppslagstjeneste som inneholder sertifikat til printleverandør og adressen til leverandøren
/// av postkassetjenesten.
/// </summary>
public class PrintSertifikatSvar
{
/// <summary>
/// <summary>
/// Et X509 Sertifikat.
/// </summary>
public X509Certificate2 Printsertifikat { get; set; }

/// <summary>
/// Adresse til en leverandør av Postkassetjeneste
/// </summary>
public string PostkasseleverandørAdresse { get; set; }
}
}
using System.Security.Cryptography.X509Certificates;

namespace Difi.Oppslagstjeneste.Klient.Domene.Entiteter.Svar
{
/// <summary>
/// Svar fra Oppslagstjeneste som inneholder sertifikat til printleverandør og adressen til leverandøren
/// av postkassetjenesten.
/// </summary>
public class PrintSertifikatSvar
{
/// <summary>
/// Et X509 Sertifikat.
/// </summary>
public X509Certificate2 Printsertifikat { get; set; }

/// <summary>
/// Adresse til en leverandør av Postkassetjeneste
/// </summary>
public string PostkasseleverandørAdresse { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

[assembly: AssemblyTitle("Difi.Oppslagstjeneste.Klient.Domene")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("Difi.Oppslagstjeneste.Klient,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")]
[assembly: InternalsVisibleTo("Difi.Oppslagstjeneste.Klient,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")]
[assembly: InternalsVisibleTo("Difi.Oppslagstjeneste.Klient.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")]
[assembly: InternalsVisibleTo("Difi.Oppslagstjeneste.Klient,PublicKey=00240000048000009400000006020000002400005253413100040000010001003db9d1db4ebec5694ba3638c201c0aea1840d137387b496016d3ec76603c1a6fe8a379e2eee7a3b4cd668b8af54d94bf0ce84ef669ea6e31ae4f92f33aa97b61137a67d9b41f91e2546896a660cfba961a3afe83d976b23146638a335ef3fa1e0693a9dc402fdfddee367c54c2d45c71d23ae50e5963115c6e903d0b50c881c3")]
[assembly: InternalsVisibleTo("Difi.Oppslagstjeneste.Klient.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001003db9d1db4ebec5694ba3638c201c0aea1840d137387b496016d3ec76603c1a6fe8a379e2eee7a3b4cd668b8af54d94bf0ce84ef669ea6e31ae4f92f33aa97b61137a67d9b41f91e2546896a660cfba961a3afe83d976b23146638a335ef3fa1e0693a9dc402fdfddee367c54c2d45c71d23ae50e5963115c6e903d0b50c881c3")]

32 changes: 0 additions & 32 deletions Difi.Oppslagstjeneste.Klient.Domene/app.config

This file was deleted.

5 changes: 0 additions & 5 deletions Difi.Oppslagstjeneste.Klient.Domene/packages.config

This file was deleted.

Loading

0 comments on commit dd67b7f

Please sign in to comment.