Skip to content

Commit

Permalink
Merge pull request #22 from digipost/strong-name
Browse files Browse the repository at this point in the history
Strong name assembly og release med github actions
  • Loading branch information
johnksv authored May 8, 2020
2 parents c258fe7 + 3b06912 commit a1f4cfe
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 54 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ jobs:
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
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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: Test
run: dotnet test --no-restore --verbosity normal
- name: Set release version
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Shared
- name: Push to NuGet
env:
NUGET_API_KEY: ${{ secrets.nugetApiKey }}
run: dotnet nuget push digipost/packed/ --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,4 @@ ASALocalRun/
#Version patcher files
Zero29.1.0.0
nuget.exe
signingkey.snk
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<Title>Digipost Api Client Shared Tests</Title>
<PackageId>Digipost.Api.Client.Shared.Tests</PackageId>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\signingkey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -65,8 +67,8 @@
</ItemGroup>

<ItemGroup>
<None Include="C:\Keys\signingkey.snk">
<Link>signingkey.snk</Link>
<None Include="..\signingkey.snk">
<Link>signingkey.snk</Link>
</None>
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions Digipost.Api.Client.Shared/Certificate/BomUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System.Runtime.CompilerServices;
using System.Text;

[assembly: InternalsVisibleTo("Digipost.Api.Client.Shared.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
[assembly: InternalsVisibleTo("Digipost.Api.Client.Shared.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100f71f491a4cebe0a3d18a61744f92edfca908e4d756aa1140ebceeffb1fc4aa2e7bbe4d672067e2c0a3afd8c4511ef84cc1267ba04d8041e24d96c3d93e268fd69abc712fa81bcbae729f1c0524eef0254705bb2fcf1ffd43a647e9306b93e8dd7afd094a61ca2761fe87c20fdda758ad55d2c5ba6ad6edc9493309a355e51f99")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]

namespace Digipost.Api.Client.Shared.Certificate
{
Expand Down Expand Up @@ -33,4 +33,4 @@ internal virtual string RemoveBom(string thumbprint)
return thumbprint;
}
}
}
}
6 changes: 4 additions & 2 deletions Digipost.Api.Client.Shared/Digipost.Api.Client.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<Title>Digipost Api Client Shared</Title>
<PackageId>Digipost.Api.Client.Shared</PackageId>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\signingkey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -53,8 +55,8 @@
</ItemGroup>

<ItemGroup>
<None Include="C:\Keys\signingkey.snk">
<Link>signingkey.snk</Link>
<None Include="..\signingkey.snk">
<Link>signingkey.snk</Link>
</None>
</ItemGroup>

Expand Down
8 changes: 0 additions & 8 deletions Digipost.Api.Client.Shared/Properties/ProjectAssemblyInfo.cs

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
## Hvordan utvikle på dette prosjektet?
Bruk Rider, som er C#-varianten av Intellij IDEA.

Fjern `AssemblyOriginatorKeyFile` og `SignAssembly` for å deaktivere strong-named assemblies under utvikling.

Har du tilgang til signingkey (digipost-utviklere) kan du evt dekryptere `signingkey.snk.enc` først.
Man kan verifisere at DLL-en er strong-named ved å benytte `sn -v <path-to-dll>`.


## Hvordan deploye?
Releasing er gjort via tagging med [Semver](http://semver.org) versjons schema. For en beta-release, bruk `-beta` som versjon suffix i taggen.
Binary file modified signingkey.snk.enc
100755 → 100644
Binary file not shown.
1 change: 0 additions & 1 deletion travis-deploy
Submodule travis-deploy deleted from 5cab18

0 comments on commit a1f4cfe

Please sign in to comment.