CI_DOCS #257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI_DOCS | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
workflow_run: | |
workflows: ["CI_REFLECT_TEST_COMMIT"] | |
branches: [master] | |
types: | |
- completed | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
check: | |
name: Check changed files | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
outputs: | |
run_job: ${{ steps.check_files.outputs.run_job }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: check files | |
id: check_files | |
run: | | |
echo "=============== list changed files ===============" | |
git diff --name-only HEAD^ HEAD | |
echo "run_job=false" >> $GITHUB_OUTPUT | |
echo "========== check paths of changed files ==========" | |
git diff --name-only HEAD^ HEAD > files.txt | |
while IFS= read -r file | |
do | |
echo $file | |
if [[ $file == ".github/workflows/docs.yaml"* ]]; then | |
echo "Recreate docs was requested" | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
break | |
fi | |
if [[ $file == "src/documentation/"* ]]; then | |
echo "This file is under the directory 'src/documentation/'." | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
break | |
fi | |
if [[ $file == "src/jvm/src/"* ]]; then | |
echo "This file is under the directory 'src/jvm/src/'." | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
break | |
fi | |
echo "This files are not in a source directory no action required" | |
done < files.txt | |
# This workflow contains a single job called "build" | |
build_docs: | |
needs: check | |
if: needs.check.outputs.run_job == 'true' | |
# The type of runner that the job will run on | |
runs-on: windows-2022 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Runs a set of commands using the runners shell | |
# Support longpaths | |
- name: Support long paths | |
run: git config --system core.longpaths true | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
submodules: 'true' | |
# Runs a set of commands using the runners shell | |
- name: Build JCOReflectorCLI | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\net\JCOReflectorCLI.sln | |
# Runs a set of commands using the runners shell | |
- name: Copy configuration file | |
run: | | |
Copy-Item .github\workflows\JCOReflectorCLI_net6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force | |
Copy-Item .github\workflows\JCOReflectorCLI_net8.0.runtimeconfig.json -Destination bin\net8.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force | |
- name: Switch to master net6.0 help file | |
run: | | |
cd .\docs\net6.0 | |
git checkout master | |
cd ..\.. | |
- name: Switch to master net8.0 help file | |
run: | | |
cd .\docs\net8.0 | |
git checkout master | |
cd ..\.. | |
- name: Switch to master net462 help file | |
run: | | |
cd .\docs\net462 | |
git checkout master | |
cd ..\.. | |
- name: Clear documentation folder | |
run: Get-ChildItem -Path .\docs -Exclude net6.0,net8.0,net462,_config.yml,CNAME,README.md | Remove-Item -Recurse -Force | |
# Runs a set of commands using the runners shell | |
- name: Clean net6.0 help file folders | |
run: Get-ChildItem -Path .\docs\net6.0 -Exclude .git,LICENSE,README.md | Remove-Item -Recurse -Force | |
- name: Clean net8.0 help file folders | |
run: Get-ChildItem -Path .\docs\net8.0 -Exclude .git,LICENSE,README.md | Remove-Item -Recurse -Force | |
- name: Clean net462 help file folders | |
run: Get-ChildItem -Path .\docs\net462 -Exclude .git,LICENSE,README.md | Remove-Item -Recurse -Force | |
- run: dotnet tool update -g docfx | |
- name: Build documentation | |
run: | | |
cd src\documentation | |
docfx | |
- name: Extract commit SHA | |
run: | | |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA)" >> $GITHUB_ENV | |
shell: bash | |
- name: Build net6.0 Java Help files | |
run: dotnet bin\net6.0\MASES.JCOReflectorCLI.dll -JobType BuildDocs -JobFile .github\workflows\builddocs_win19.job -CommitVersion ${{ env.GITHUB_COMMIT_MESSAGE }} -JDKFolder %JAVA_HOME_11_X64% | |
shell: cmd | |
- name: Build net8.0 Java Help files | |
run: dotnet bin\net8.0\MASES.JCOReflectorCLI.dll -JobType BuildDocs -JobFile .github\workflows\builddocs_win19.job -CommitVersion ${{ env.GITHUB_COMMIT_MESSAGE }} -JDKFolder %JAVA_HOME_11_X64% | |
shell: cmd | |
- name: Build net462 Java Help files | |
run: .\bin\net462\MASES.JCOReflectorCLI -JobType BuildDocs -JobFile .github\workflows\builddocs_win19.job -CommitVersion ${{ env.GITHUB_COMMIT_MESSAGE }} -JDKFolder %JAVA_HOME_11_X64% | |
shell: cmd | |
- name: Clean temporary files | |
run: | | |
Remove-Item .\bin\* -Recurse -Force | |
Remove-Item .\src\net\CLI\obj\* -Recurse -Force | |
Remove-Item .\src\net\engine\obj\* -Recurse -Force | |
- name: Commit changes to net6.0 help file | |
run: | | |
cd .\docs\net6.0 | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help file to commit masesgroup/JCOReflector@${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd ..\..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Commit changes to net8.0 help file | |
run: | | |
cd .\docs\net8.0 | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help file to commit masesgroup/JCOReflector@${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd ..\..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Commit changes to net462 help file | |
run: | | |
cd .\docs\net462 | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help file to commit masesgroup/JCOReflector@${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd ..\..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Commit changes to JCOReflector repo | |
run: | | |
cd .\docs\ | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help submodule after commit ${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd .. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Push changes to net6.0 help file | |
run: | | |
cd .\docs\net6.0 | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
cd ..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/NET6Docs | |
- name: Push changes to net8.0 help file | |
run: | | |
cd .\docs\net8.0 | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
cd ..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/NET8Docs | |
- name: Push changes to net462 help file | |
run: | | |
cd .\docs\net462 | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
cd ..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/FrameworkDocs | |
- name: Commit changes to JCOReflector | |
run: | | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/JCOReflector |