<commit_before>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
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Common
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Docs
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Inbox
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Resources
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Scripts
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Send
    - name: Push Client to NuGet
      env:
        NUGET_API_KEY: ${{ secrets.nugetApiKey }}<commit_msg>Set assembly version to '<major>.0.0' when releasing new version.<commit_after>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: Set assembly version to major semver
      run: echo ::set-env name=ASSEMBLY_VERSION::$(echo ${GITHUB_REF:10} | cut -d '.' -f 1).0.0
    - 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 digipost/packed Digipost.Api.Client
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Common
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Docs
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Inbox
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Resources
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Scripts
    - name: Pack nupkg
      run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Send
    - name: Push Client to NuGet
      env:
        NUGET_API_KEY: ${{ secrets.nugetApiKey }}
{'fraction_non_alphanumeric': 0.10838946723821188, 'fraction_numerical': 0.006736068585425597, 'mean_word_length': 3.0196882690730105, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5422597', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1508, 'n_words': 400}