You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
4.3 KiB

5 years ago
5 years ago
  1. version: 'BSIPA-{branch}-{build}'
  2. environment:
  3. bsipa_version: '3.12.24'
  4. gh_token:
  5. secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU
  6. do_deploy: true
  7. matrix:
  8. - BUILD_DOC: 'yes'
  9. - BUILD_DOC: 'no'
  10. pull_requests:
  11. do_not_increment_build_number: true
  12. install:
  13. - git submodule update --init --recursive
  14. - nuget restore
  15. - ps: |
  16. if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
  17. {
  18. #git checkout $env:APPVEYOR_REPO_BRANCH -q
  19. choco install docfx -y
  20. }
  21. image: Visual Studio 2019
  22. configuration:
  23. - Release
  24. platform:
  25. - x64
  26. #- x86
  27. artifacts: # When Net3 is added, this will need to be moved to the for block to only run for Net4 builds
  28. - path: BSIPA-Net4-Meta/bin/$(configuration)
  29. name: BSIPA-$(platform)
  30. - path: BSIPA-ModList/bin/$(configuration)
  31. name: ModList
  32. - path: ./
  33. name: DirDebug
  34. #matrix:
  35. #exclude:
  36. #- BUILD_DOC: 'yes' # Add one of these for most configuration sets, so we don't dupe
  37. # configuration: Release
  38. # platform: x64
  39. for:
  40. -
  41. matrix:
  42. except:
  43. - BUILD_DOC: 'yes'
  44. skip_tags: true
  45. -
  46. matrix:
  47. except:
  48. - BUILD_DOC: 'no'
  49. artifacts:
  50. environment:
  51. do_deploy: false
  52. skip_tags: false
  53. build_script:
  54. - ps: |
  55. if ($env:APPVEYOR_REPO_BRANCH -eq 'master')
  56. {
  57. cd docs
  58. function Git-Do {
  59. git config --global core.autocrlf true
  60. git config --global credential.helper store
  61. Add-Content "$HOME\.git-credentials" "https://$($env:gh_token):[email protected]`n"
  62. git config --global user.email $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
  63. git config --global user.name $env:APPVEYOR_REPO_COMMIT_AUTHOR
  64. git clone -q "https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git" -b gh-pages origin_site
  65. if (-Not (Test-Path origin_site/tags))
  66. { New-Item -ItemType directory -Path origin_site/tags }
  67. }
  68. function Do-DocFX
  69. {
  70. Add-Content link_branch.json "{`"_gitContribute`":{`"sourceBranch`":`"$env:APPVEYOR_REPO_COMMIT`",`"apiSpecFolder`":`"docs/override`"}}"
  71. & docfx metadata
  72. & docfx build --globalMetadataFiles link_branch.json @Args
  73. if ($lastexitcode -ne 0){
  74. throw [System.Exception] "docfx build failed with exit code $lastexitcode."
  75. }
  76. }
  77. if ($env:APPVEYOR_REPO_TAG -eq "true")
  78. { # Copy current site into tags
  79. & Do-DocFX
  80. & Git-Do
  81. cd origin_site # make things a bit easier
  82. $tagPath = "tags/$env:APPVEYOR_REPO_TAG_NAME"
  83. Move-Item ../_site $tagPath
  84. git add -A 2>&1
  85. git commit -q -a -m "Saved tag $env:APPVEYOR_REPO_TAG_NAME" 2>&1
  86. }
  87. elseif (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
  88. { # Generate docs
  89. & Do-DocFX
  90. & Git-Do
  91. Move-Item origin_site/.git _site
  92. Move-Item origin_site/tags _site
  93. CD _site
  94. git add -A 2>&1
  95. git commit -q -a -m "$env:APPVEYOR_REPO_COMMIT_MESSAGE -- Generated Docs" 2>&1
  96. }
  97. git push -q origin gh-pages 2>&1
  98. }
  99. branches:
  100. except:
  101. - gh-pages
  102. cache:
  103. - '%LocalAppData%\NuGet\v3-cache' # NuGet v3
  104. build:
  105. verbosity: normal
  106. project: BSIPA.sln
  107. deploy:
  108. - provider: GitHub
  109. release: BSIPA $(bsipa_version)-draft
  110. tag: $(bsipa_version)-d
  111. description: |
  112. **Build:** [$(bsipa_version)-$(APPVEYOR_BUILD_NUMBER)](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/builds/$(APPVEYOR_BUILD_ID)) [$(configuration)|$(platform)]
  113. **Latest Commit:** $(APPVEYOR_REPO_COMMIT)
  114. - `$(APPVEYOR_REPO_COMMIT_MESSAGE)`
  115. - `$(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)`
  116. auth_token:
  117. secure: KhF3q/zWEFwrW0QeZLqE3NAkWR4u9iVhsmcyzXvwwJ28fUy+MzW4CWBx3RxNM60t
  118. artifact: /.*\.zip/
  119. draft: true
  120. force_update: true
  121. on:
  122. branch: master
  123. APPVEYOR_REPO_TAG: false
  124. do_deploy: true