<commit_before>#  reference: https://www.appveyor.com/docs/appveyor-yml/

# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}

version: 4.0.0.{build}
pull_requests:
  do_not_increment_build_number: true
skip_tags: true


# branches to build 
branches:
  # whitelist
  only:
    - master

#---------------------------------#
#    environment configuration    #
#---------------------------------#
environment:
  github_access_token:
    secure: <KEY>
  github_email:
    secure: <KEY>
  github_user: NicolasDorier

    

image: Visual Studio 2017
clone_folder: c:\projects\nbitcoin

clone_depth: 1

configuration:
- Release

init:
- ps: dotnet --info

#---------------------------------#
#       build configuration       #
#---------------------------------#
before_build:
- ps: |
      Write-Host "[$env:configuration] STARTED dotnet restore" -foregroundcolor "magenta"
      
      dotnet restore -v m
      Write-Host "[$env:configuration] FINISHED dotnet restore" -foregroundcolor "magenta"
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
    
build_script:
- ps: |
      Write-Host "[$env:configuration] STARTED dotnet build" -foregroundcolor "magenta"
      dotnet msbuild /p:Configuration=$env:configuration /p:Version=$env:APPVEYOR_BUILD_VERSION 
      Write-Host "[$env:configuration] FINISHED dotnet build" -foregroundcolor "magenta"
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
# scripts to run after build
after_build:
- ps: |
      if($env:configuration -eq 'Release')
      {
        Write-Host "[$env:configuration] STARTED dotnet pack" -foregroundcolor "magenta"
        
        cd NBitcoin
        dotnet pack -c $env:configuration -v m --no-build -o $env:APPVEYOR_BUILD_FOLDER\nuget\      
        
        Write-Host "[$env:configuration] FINISHED dotnet pack" -foregroundcolor "magenta"
      }
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
    
test_script:
- ps: |
      Write-Host "[$env:configuration] STARTED dotnet test" -foregroundcolor "magenta"
      cd $env:APPVEYOR_BUILD_FOLDER
      dotnet test -c Release ./NBitcoin.Tests/NBitcoin.Tests.csproj --filter "RestClient=RestClient|RPCClient=RPCClient|Protocol=Protocol|Core=Core|UnitTest=UnitTest" -p:ParallelizeTestCollections=false -f net461
      Write-Host "[$env:configuration] FINISHED dotnet test" -foregroundcolor "magenta"
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }

#---------------------------------#	
#      docs configuration         #	
#---------------------------------#     	
 on_success: 	
- ps: |	
       	
        if ($env:APPVEYOR_REPO_TAG) { 	
            Write-Host "Generating Docs "	
            cinst docfx	
            git config --global credential.helper store	
            Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:github_access_token):x-oauth-basic@github.com`n"	
            git config --global user.email $env:github_email
            git config --global user.name $env:github_user
            git config --global core.safecrlf false	
            sh ./docs/release.sh 	
        } else {	
            Write-Host "Not a tagged build, skipping doc generation"	
        }

#---------------------------------#
      
#---------------------------------#
#      artifacts configuration    #
#---------------------------------#

# pushing all files in build directory recursively
artifacts:
- path: nuget\*.nupkg
  name: nuget packages
<commit_msg>Fix appveyor<commit_after>#  reference: https://www.appveyor.com/docs/appveyor-yml/

# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}

version: 4.0.0.{build}
pull_requests:
  do_not_increment_build_number: true
skip_tags: true


# branches to build 
branches:
  # whitelist
  only:
    - master

#---------------------------------#
#    environment configuration    #
#---------------------------------#
environment:
  github_access_token:
    secure: <KEY>
  github_email:
    secure: <KEY>
  github_user: NicolasDorier

    

image: Visual Studio 2017
clone_folder: c:\projects\nbitcoin

clone_depth: 1

configuration:
- Release

init:
- ps: dotnet --info

#---------------------------------#
#       build configuration       #
#---------------------------------#
before_build:
- ps: |
      Write-Host "[$env:configuration] STARTED dotnet restore" -foregroundcolor "magenta"
      
      dotnet restore -v m
      Write-Host "[$env:configuration] FINISHED dotnet restore" -foregroundcolor "magenta"
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
    
build_script:
- ps: |
      Write-Host "[$env:configuration] STARTED dotnet build" -foregroundcolor "magenta"
      dotnet msbuild /p:Configuration=$env:configuration /p:Version=$env:APPVEYOR_BUILD_VERSION 
      Write-Host "[$env:configuration] FINISHED dotnet build" -foregroundcolor "magenta"
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
# scripts to run after build
after_build:
- ps: |
      if($env:configuration -eq 'Release')
      {
        Write-Host "[$env:configuration] STARTED dotnet pack" -foregroundcolor "magenta"
        
        cd NBitcoin
        dotnet pack -c $env:configuration -v m --no-build -o $env:APPVEYOR_BUILD_FOLDER\nuget\      
        
        Write-Host "[$env:configuration] FINISHED dotnet pack" -foregroundcolor "magenta"
      }
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
    
test_script:
- ps: |
      Write-Host "[$env:configuration] STARTED dotnet test" -foregroundcolor "magenta"
      cd $env:APPVEYOR_BUILD_FOLDER
      dotnet test -c Release ./NBitcoin.Tests/NBitcoin.Tests.csproj --filter "RestClient=RestClient|RPCClient=RPCClient|Protocol=Protocol|Core=Core|UnitTest=UnitTest" -p:ParallelizeTestCollections=false -f net461
      Write-Host "[$env:configuration] FINISHED dotnet test" -foregroundcolor "magenta"
      if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }

#---------------------------------#	
#      docs configuration         #	
#---------------------------------#     	
 on_success: 	
- ps: |	
        if ($env:APPVEYOR_REPO_TAG)
        { 	
            Write-Host "Generating Docs"	
            cinst docfx	
            git config --global credential.helper store	
            Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:github_access_token):x-oauth-basic@github.com`n"	
            git config --global user.email $env:github_email
            git config --global user.name $env:github_user
            git config --global core.safecrlf false	
            sh ./docs/release.sh 	
        } 
        else 
        {	
            Write-Host "Not a tagged build, skipping doc generation"	
        }

#---------------------------------#
      
#---------------------------------#
#      artifacts configuration    #
#---------------------------------#

# pushing all files in build directory recursively
artifacts:
- path: nuget\*.nupkg
  name: nuget packages

{'fraction_non_alphanumeric': 0.18676156583629894, 'fraction_numerical': 0.004839857651245552, 'mean_word_length': 2.0951541850220265, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '5341696', 'n_tokens_mistral': 2177, 'n_tokens_neox': 2108, 'n_words': 477}