Skip to content

Instantly share code, notes, and snippets.

@khalidabuhakmeh
Created September 25, 2018 16:43
Show Gist options
  • Save khalidabuhakmeh/467012d14a6c1aefacc5b5863867fe6e to your computer and use it in GitHub Desktop.
Save khalidabuhakmeh/467012d14a6c1aefacc5b5863867fe6e to your computer and use it in GitHub Desktop.
image: Visual Studio 2017
environment:
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1
cache:
- packages -> **\packages.config, nuget.config
- tools -> build.cake
install:
- choco install gitversion.portable -pre -y
before_build:
- ps: C:\ProgramData\chocolatey\bin\gfv.exe $env:APPVEYOR_BUILD_FOLDER /l console /output buildserver /updateAssemblyInfo /nofetch /b $env:APPVEYOR_REPO_BRANCH
build_script:
- ps: ./build.ps1
test: off
# Do not build on tags (GitHub and BitBucket)
# Needed because with GitVersion we tag the master branch after a deployment
skip_tags: true
artifacts:
- path: ./msbuild.log
- path: ./artifacts/*.nupkg
- path: ./artifacts/Api.zip
name: Api
type: Zip
deploy:
- provider: Environment
name: AppVeyor Private Feed
# Any merge into master will trigger a GitHub Release to be published
# https://www.appveyor.com/docs/deployment/github/
# This tagging helps GitVersion's prediction of the next SemVer
- provider: Environment
name: GitHub
github_tag_name: v$(GitVersion_NuGetVersionV2)
on:
branch: master
- provider: Environment
name: MyGet
on:
branch: development
- provider: Environment
name: MyGet
on:
branch: master
@khalidabuhakmeh
Copy link
Author

ERROR [09/25/18 16:45:54:83] An unexpected error occurred:
GitTools.WarningException: It looks like the branch being examined is a detached Head pointing to commit '9e7cda0'. With
out a proper branch name GitVersion cannot determine the build version.
   at GitVersion.GitVersionFinder.EnsureHeadIsNotDetached(GitVersionContext context)
   at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context)
   at GitVersion.ExecuteCore.<>c__DisplayClass6_0.<ExecuteInternal>b__0(IRepository repo)
   at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authen
tication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean
 noCache)
   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
   at GitVersion.Program.VerifyArgumentsAndRun()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment