Search code examples
githubbuildappveyor

Appveyor, GitHub, multiple projects in repo


enter image description here

I am trying to get just one folder to build (see above). I have the following YML file in that folder:

version: '0.0.{build}'
image: Visual Studio 2017
configuration: Release
build: off

notifications:
- provider: Email
  to:
  - keith@sol3.net
  subject: CI build 0.0.{build} failed!
  on_build_success: false
  on_build_failure: true
  on_build_status_changed: false


init:
  # Best practice (Windows line endings different to Unix/Linux)
  - cmd: git config --global core.autocrlf true

install:
  appveyor DownloadFile https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe

before_build:
  # Display .NET Core version
  - cmd: dotnet --version
  # Change to specific project folder
  - cmd: cd Sol3.Infrastructure
  # Display minimal restore text
  - cmd: dotnet restore Sol3.Infrastructure.csproj --verbosity m

build_script:
  - cmd: dotnet build Sol3.Infrastructure.csproj
  - cmd: dotnet pack -c Release /p:PackageVersion=0.0.{build} 

after_build:
  # For once the build has completed

on_finish :
  # any cleanup in here
deploy: off

Constantly getting error of too many SLN/PRJ files. Also noticed that it is NOT using this file as the version is matching the default settings in Appveyor itself. Appveyor's appveyor.yml file:

version: 1.0.{build}
build:
  verbosity: minimal

Can appveyor do this? Is appveyor the best choice? Any guidance?

This is my sandbox (tiny right now) and I have several projects and would like each project to have it's own appveyor.yml file. I do have SLN files in there too and those are artifacts from VS2017 before I switched to VSCode. Thinking I should delete those now until I need to put a SLN together...


Solution

  • By default AppVeyor checks for appveyor.yml or .appveyor.yml in the root of your repo. If you need to specify custom file name or custom path (relative to the repo root), you need to do this in Custom configuration .yml file name filed in General project setting. Some more information is here. What probably happens now is that AppVeyor has not idea about your YML file in the Sol3.Infrastructure and goes with default configuration in which it searches for VS solution or project to build.

    Side notes:

    • nuget is pre-installed
    • I would recommend using paths relative to the build folder, instead of doing CD
    • no need to cleanup at on_finish, each build runs on transient VM, which is being deleted right after build finished