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.

149 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: 'no'
  9. - BUILD_DOC: 'yes'
  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. #matrix:
  33. #exclude:
  34. #- BUILD_DOC: 'yes' # Add one of these for most configuration sets, so we don't dupe
  35. # configuration: Release
  36. # platform: x64
  37. for:
  38. -
  39. matrix:
  40. except:
  41. - BUILD_DOC: 'yes'
  42. skip_tags: true
  43. -
  44. matrix:
  45. except:
  46. - BUILD_DOC: 'no'
  47. artifacts:
  48. environment:
  49. do_deploy: false
  50. skip_tags: false
  51. build_script:
  52. - ps: |
  53. if ($env:APPVEYOR_REPO_BRANCH -eq 'master')
  54. {
  55. cd docs
  56. function Git-Do {
  57. git config --global core.autocrlf true
  58. git config --global credential.helper store
  59. Add-Content "$HOME\.git-credentials" "https://$($env:gh_token):[email protected]`n"
  60. git config --global user.email $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
  61. git config --global user.name $env:APPVEYOR_REPO_COMMIT_AUTHOR
  62. git clone -q "https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git" -b gh-pages origin_site
  63. if (-Not (Test-Path origin_site/tags))
  64. { New-Item -ItemType directory -Path origin_site/tags }
  65. }
  66. function Do-DocFX
  67. {
  68. Add-Content link_branch.json "{`"_gitContribute`":{`"sourceBranch`":`"$env:APPVEYOR_REPO_COMMIT`",`"apiSpecFolder`":`"docs/override`"}}"
  69. & docfx metadata
  70. & docfx build --globalMetadataFiles link_branch.json @Args
  71. if ($lastexitcode -ne 0){
  72. throw [System.Exception] "docfx build failed with exit code $lastexitcode."
  73. }
  74. }
  75. if ($env:APPVEYOR_REPO_TAG -eq "true")
  76. { # Copy current site into tags
  77. & Do-DocFX
  78. & Git-Do
  79. cd origin_site # make things a bit easier
  80. $tagPath = "tags/$env:APPVEYOR_REPO_TAG_NAME"
  81. Move-Item ../_site $tagPath
  82. git add -A 2>&1
  83. git commit -q -a -m "Saved tag $env:APPVEYOR_REPO_TAG_NAME" 2>&1
  84. }
  85. elseif (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
  86. { # Generate docs
  87. & Do-DocFX
  88. & Git-Do
  89. Move-Item origin_site/.git _site
  90. Move-Item origin_site/tags _site
  91. CD _site
  92. git add -A 2>&1
  93. git commit -q -a -m "$env:APPVEYOR_REPO_COMMIT_MESSAGE -- Generated Docs" 2>&1
  94. }
  95. git push -q origin gh-pages 2>&1
  96. }
  97. branches:
  98. except:
  99. - gh-pages
  100. cache:
  101. - '%LocalAppData%\NuGet\v3-cache' # NuGet v3
  102. build:
  103. verbosity: normal
  104. project: BSIPA.sln
  105. deploy:
  106. - provider: GitHub
  107. release: BSIPA $(bsipa_version)-draft
  108. tag: $(bsipa_version)-d
  109. description: |
  110. **Build:** [$(bsipa_version)-$(APPVEYOR_BUILD_NUMBER)](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/builds/$(APPVEYOR_BUILD_ID)) [$(configuration)|$(platform)]
  111. **Latest Commit:** $(APPVEYOR_REPO_COMMIT)
  112. - `$(APPVEYOR_REPO_COMMIT_MESSAGE)`
  113. - `$(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)`
  114. auth_token:
  115. secure: KhF3q/zWEFwrW0QeZLqE3NAkWR4u9iVhsmcyzXvwwJ28fUy+MzW4CWBx3RxNM60t
  116. artifact: '/.*[^_]\.zip/'
  117. draft: true
  118. force_update: true
  119. on:
  120. branch: master
  121. APPVEYOR_REPO_TAG: false
  122. do_deploy: true