From c5280891ca5cb6872805f51c28da6fde3b8bfcaa Mon Sep 17 00:00:00 2001 From: Simon Baynes Date: Fri, 2 Aug 2024 17:11:54 +0100 Subject: [PATCH] Reinstate document generation on successful build Closes #330 --- .github/workflows/publish-docs.yml | 19 ++++++++++++ CHANGELOG.md | 1 + Html2Markdown.sln | 1 - pushDocumentation.ps1 | 48 ------------------------------ 4 files changed, 20 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/publish-docs.yml delete mode 100644 pushDocumentation.ps1 diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 00000000..0e5eca29 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,19 @@ +name: Push Documentation + +on: + push: + branches: + - master + workflow_dispatch: + + +jobs: + push-documentation: + runs-on: ubuntu-latest + environment: github-pages + steps: + - uses: DenverCoder1/doxygen-github-pages-action@v1.3.0 + with: + github_token: ${{ secrets.PUBLISH_DOCS_TOKEN }} + branch: gh-pages + config_file: doxygen.config \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 99acd7e2..3c8661cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added missing XML docs for classes and methods - Pushing beta packages to NuGet from `develop` branch - Added README to NuGet package +- Reinstate document publishing on successful merge to `master` ## [6.2.1.4] - 2024-05-07 diff --git a/Html2Markdown.sln b/Html2Markdown.sln index 974de2e5..d94b49e4 100644 --- a/Html2Markdown.sln +++ b/Html2Markdown.sln @@ -23,7 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution doxygen.config = doxygen.config ISSUE_TEMPLATE.md = ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md = PULL_REQUEST_TEMPLATE.md - pushDocumentation.ps1 = pushDocumentation.ps1 README.md = README.md semver.json = semver.json LICENSE.txt = LICENSE.txt diff --git a/pushDocumentation.ps1 b/pushDocumentation.ps1 deleted file mode 100644 index 19b004e4..00000000 --- a/pushDocumentation.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -param([string]$buildFolder, [string]$email, [string]$username, [string]$personalAccessToken, [string]$currentBranch) - -if($currentBranch -eq 'master') { - Write-Host "- Installing Doxygen" - choco install doxygen.portable - - Write-Host "- Generating documentation" - C:/ProgramData/chocolatey/lib/doxygen.portable/tools/doxygen.exe doxygen.config - - Write-Host "- Set config settings...." - git config --global user.email $email - git config --global user.name $username - git config --global push.default matching - - Write-Host "- Clone gh-pages branch...." - cd "$($buildFolder)\..\" - mkdir gh-pages - git clone --quiet --branch=gh-pages https://$($username):$($personalAccessToken)@github.com/baynezy/Html2Markdown.git .\gh-pages\ - cd gh-pages - git status - - Write-Host "- Clean gh-pages folder...." - Get-ChildItem -Attributes !r | Remove-Item -Recurse -Force - - Write-Host "- Copy contents of documentation folder into gh-pages folder...." - copy-item -path ..\documentation\html\* -Destination $pwd.Path -Recurse - - git status - $thereAreChanges = git status | select-string -pattern "Changes not staged for commit:","Untracked files:" -simplematch - if ($thereAreChanges -ne $null) { - Write-host "- Committing changes to documentation..." - git add --all - git status - git commit -m "skip ci - static site regeneration" - git status - Write-Host "- Push it...." - git push --quiet - Write-Host "- Pushed it" - } - else { - Write-Host "- No changes to documentation to commit" - } - - cd $buildFolder -} -else { - Write-Host "- Not pushing documentation as '$currentBranch' does not match 'master'" -} \ No newline at end of file