mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
44 lines
1.6 KiB
PowerShell
44 lines
1.6 KiB
PowerShell
$bf = $Env:APPVEYOR_BUILD_FOLDER
|
|
|
|
$doxdir = "C:\tgsdox"
|
|
|
|
New-Item -Path $doxdir -ItemType directory
|
|
|
|
$publish_dox = (-not (Test-Path Env:APPVEYOR_PULL_REQUEST_NUMBER)) -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master")
|
|
|
|
if($publish_dox){
|
|
$github_url = "github.com/$Env:APPVEYOR_REPO_NAME"
|
|
echo "Cloning https://git@$github_url..."
|
|
git clone -b gh-pages --single-branch "https://git@$github_url" "$doxdir" 2>$null
|
|
rm -r "$doxdir\*"
|
|
Add-Content "$bf\docs\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/build/tgs.ico"
|
|
}else{
|
|
Add-Content "$bf\docs\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/build/tgs.ico`nHAVE_DOT=YES"
|
|
}
|
|
|
|
&"C:\Program Files\doxygen\bin\doxygen.exe" "$bf\docs\Doxyfile"
|
|
|
|
if($publish_dox){
|
|
cd $doxdir
|
|
git config --global push.default simple
|
|
git config user.name "tgstation-server"
|
|
git config user.email "tgstation-server@tgstation13.org"
|
|
echo '# THIS BRANCH IS AUTO GENERATED BY APPVEYOR CI' > README.md
|
|
|
|
# Add in the swagger specification
|
|
cp C:/swagger.json "$doxdir/swagger.json"
|
|
|
|
# Need to create a .nojekyll file to allow filenames starting with an underscore
|
|
# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file.
|
|
echo "" > .nojekyll
|
|
git add --all
|
|
git commit -m "Deploy code docs to GitHub Pages for Appveyor build $Env:APPVEYOR_BUILD_NUMBER" -m "Commit: $Env:APPVEYOR_REPO_COMMIT"
|
|
git push -f "https://$Env:TGS4_TEST_GITHUB_TOKEN@$github_url" 2>&1 | out-null
|
|
cd "$bf"
|
|
rm -r "$doxdir/.git"
|
|
}
|
|
mv C:/tgsdox "$bf/tgsdox"
|
|
|
|
# Add in the swagger specification
|
|
cp C:/swagger.json "$bf/swagger.json"
|