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.

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