version: '{build}' image: - Visual Studio 2019 - Ubuntu environment: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true APPVEYOR_YML_DISABLE_PS_LINUX: false BUILD_SUFFIX: "" VERSION_SUFFIX: "" configuration: Release pull_requests: do_not_increment_build_number: true nuget: disable_publish_on_pr: true branches: only: - master - /\d*\.\d*\.\d*/ init: # Good practise, because Windows line endings are different from Unix/Linux ones - ps: git config --global core.autocrlf true - ps: $commitHash = $($env:APPVEYOR_REPO_COMMIT.substring(0,7)); - ps: $branch = $env:APPVEYOR_REPO_BRANCH; - ps: $buildNumber = $env:APPVEYOR_BUILD_NUMBER; - ps: $isRepoTag = $env:APPVEYOR_REPO_TAG; - ps: $revision = $(If ($isRepoTag -eq "true") {[string]::Empty} Else {"{0:00000}" -f [convert]::ToInt32("0" + $buildNumber, 10)}); - ps: $suffix = $(If ([string]::IsNullOrEmpty($revision)) {[string]::Empty} Else {$branch.Substring(0, [math]::Min(10,$branch.Length))}); - ps: $env:BUILD_SUFFIX = $(If ([string]::IsNullOrEmpty($suffix)) {"$branch-$commitHash"} Else {"$suffix-$commitHash"}); - ps: $env:VERSION_SUFFIX = $(If ([string]::IsNullOrEmpty($suffix)) {[string]::Empty} Else {"--version-suffix=$suffix"}); install: - ps: dotnet restore redmine-net-api.sln before_build: - ps: write-host "Is repo tag = $isRepoTag" -foregroundcolor Green - ps: write-host "Build number = $buildNumber" -foregroundcolor Magenta - ps: write-host "Branch = $branch" -foregroundcolor DarkYellow - ps: write-host "Revision = $revision" -foregroundcolor Cyan - ps: write-host "Build suffix = $env:BUILD_SUFFIX" -foregroundcolor Yellow - ps: write-host "Version suffix = $env:VERSION_SUFFIX" -foregroundcolor Red - ps: dotnet --version build_script: - ps: dotnet build src\redmine-net-api\redmine-net-api.csproj -c Release --version-suffix=$env:BUILD_SUFFIX - ps: dotnet build src\redmine-net-api\redmine-net-api.csproj -c Release --version-suffix=$env:BUILD_SUFFIX -p:Sign=true after_build: - ps: dotnet pack src\redmine-net-api\redmine-net-api.csproj -c Release --output .\artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build $env:VERSION_SUFFIX - ps: dotnet pack src\redmine-net-api\redmine-net-api.csproj -c Release --output .\artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build $env:VERSION_SUFFIX -p:Sign=true test: off artifacts: - name: NuGet Packages path: .\artifacts\**\*.nupkg - name: NuGet Symbol Packages path: .\artifacts\**\*.snupkg skip_commits: files: - '**/*.md' - '**/*.gif' - '**/*.png' - LICENSE - tests/* for: - matrix: only: - image: Ubuntu deploy: - provider: NuGet name: production api_key: secure: fEZylRkHvyJqjgeQ+i9TfL/JOPjLKr43k+a8Oy5MIy54IkFC8ZECaEfskcWOyqcg skip_symbols: true on: APPVEYOR_REPO_TAG: true