From d928c3342622c45d47f729ff2ceffa1cc8d0f80e Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 09:44:16 +0100 Subject: [PATCH 1/7] Fix API docs --- .github/workflows/docs.yml | 59 +++++++++++++++++++ .github/workflows/publish.yml | 12 ---- .../docs-source/docfx.json | 4 +- .../docs-source/docfx.local.json | 4 +- .../docs-source/docfx.json | 2 +- .../docs-source/docfx.local.json | 2 +- .../docs-source/docfx.json | 2 +- .../docs-source/docfx.local.json | 2 +- .../docs-source/docfx.json | 2 +- .../docs-source/docfx.local.json | 2 +- .../docs-source/docfx.json | 2 +- .../docs-source/docfx.local.json | 2 +- 12 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..dfd49577 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,59 @@ +name: Generate API docs + +on: + workflow_dispatch: + + push: + branches: ["fix/api-docs"] + +permissions: + contents: read + +jobs: + generate-docs: + name: Generate API docs + runs-on: windows-latest + environment: 'release' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.branch }} + + - name: Install Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + + - name: Install .NET + uses: actions/setup-dotnet@v3 + + - name: Install .NET Android and iOS workload + run: dotnet workload install android ios + + - name: Setup NuGet + uses: nuget/setup-nuget@v1 + + - name: Restore NuGet + run: nuget restore Auth0.OidcClient.All.sln + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.1 + + - name: Build + run: msbuild Auth0.OidcClient.All.sln -t:rebuild -verbosity:diag -property:Configuration=Release + + - name: Install DocFX + run: dotnet tool install -g docfx + + - name: Build docs + run: ./tools/build-docs.sh + shell: bash + + - uses: actions/upload-artifact@v3 + with: + name: docs + path: docs \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 92216bf0..33714bdd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -58,18 +58,6 @@ jobs: nuget pack nuget/Auth0.OidcClient.WinForms.nuspec nuget pack nuget/Auth0.OidcClient.WPF.nuspec - - name: Install DocFX - run: dotnet tool install -g docfx - - - name: Build docs - run: ./tools/build-docs.sh - shell: bash - - - uses: actions/upload-artifact@v3 - with: - name: docs - path: docs - - uses: actions/upload-artifact@v3 with: name: drop diff --git a/src/Auth0.OidcClient.Android/docs-source/docfx.json b/src/Auth0.OidcClient.Android/docs-source/docfx.json index 380942dd..e0b559c8 100644 --- a/src/Auth0.OidcClient.Android/docs-source/docfx.json +++ b/src/Auth0.OidcClient.Android/docs-source/docfx.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", @@ -26,7 +26,7 @@ "bin/Release/**/mscorlib.dll", "bin/Release/**/System*.dll" ], - "cwd": "../" + "src": "../" } ] diff --git a/src/Auth0.OidcClient.Android/docs-source/docfx.local.json b/src/Auth0.OidcClient.Android/docs-source/docfx.local.json index 4980e84c..942ed336 100644 --- a/src/Auth0.OidcClient.Android/docs-source/docfx.local.json +++ b/src/Auth0.OidcClient.Android/docs-source/docfx.local.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", @@ -26,7 +26,7 @@ "bin/Release/**/mscorlib.dll", "bin/Release/**/System*.dll" ], - "cwd": "../" + "src": "../" } ] diff --git a/src/Auth0.OidcClient.UWP/docs-source/docfx.json b/src/Auth0.OidcClient.UWP/docs-source/docfx.json index 1a305ac5..2724a84f 100644 --- a/src/Auth0.OidcClient.UWP/docs-source/docfx.json +++ b/src/Auth0.OidcClient.UWP/docs-source/docfx.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.UWP/docs-source/docfx.local.json b/src/Auth0.OidcClient.UWP/docs-source/docfx.local.json index 7fc3f63c..63600360 100644 --- a/src/Auth0.OidcClient.UWP/docs-source/docfx.local.json +++ b/src/Auth0.OidcClient.UWP/docs-source/docfx.local.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.WPF/docs-source/docfx.json b/src/Auth0.OidcClient.WPF/docs-source/docfx.json index 1a305ac5..2724a84f 100644 --- a/src/Auth0.OidcClient.WPF/docs-source/docfx.json +++ b/src/Auth0.OidcClient.WPF/docs-source/docfx.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.WPF/docs-source/docfx.local.json b/src/Auth0.OidcClient.WPF/docs-source/docfx.local.json index 7fc3f63c..63600360 100644 --- a/src/Auth0.OidcClient.WPF/docs-source/docfx.local.json +++ b/src/Auth0.OidcClient.WPF/docs-source/docfx.local.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.WinForms/docs-source/docfx.json b/src/Auth0.OidcClient.WinForms/docs-source/docfx.json index 1a305ac5..2724a84f 100644 --- a/src/Auth0.OidcClient.WinForms/docs-source/docfx.json +++ b/src/Auth0.OidcClient.WinForms/docs-source/docfx.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.WinForms/docs-source/docfx.local.json b/src/Auth0.OidcClient.WinForms/docs-source/docfx.local.json index 7fc3f63c..63600360 100644 --- a/src/Auth0.OidcClient.WinForms/docs-source/docfx.local.json +++ b/src/Auth0.OidcClient.WinForms/docs-source/docfx.local.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.iOS/docs-source/docfx.json b/src/Auth0.OidcClient.iOS/docs-source/docfx.json index 1a305ac5..2724a84f 100644 --- a/src/Auth0.OidcClient.iOS/docs-source/docfx.json +++ b/src/Auth0.OidcClient.iOS/docs-source/docfx.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", diff --git a/src/Auth0.OidcClient.iOS/docs-source/docfx.local.json b/src/Auth0.OidcClient.iOS/docs-source/docfx.local.json index 7fc3f63c..63600360 100644 --- a/src/Auth0.OidcClient.iOS/docs-source/docfx.local.json +++ b/src/Auth0.OidcClient.iOS/docs-source/docfx.local.json @@ -7,7 +7,7 @@ "bin/Release/**/Auth0.OidcClient.dll", "bin/Release/**/Auth0.OidcClient.Core.dll" ], - "cwd": "../" + "src": "../" } ], "dest": "api", From 642adb69eb4ee074a16fd8be71a2c8c07c9f1b8c Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 10:06:26 +0100 Subject: [PATCH 2/7] Deploy API docs automatically --- .github/workflows/docs.yml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dfd49577..1d765e21 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,9 +3,6 @@ name: Generate API docs on: workflow_dispatch: - push: - branches: ["fix/api-docs"] - permissions: contents: read @@ -56,4 +53,28 @@ jobs: - uses: actions/upload-artifact@v3 with: name: docs - path: docs \ No newline at end of file + path: docs + + # Deploy job + deploy-docs: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action + with: + artifact_name: docs \ No newline at end of file From 5b8a23c4abe8bbe2f945092756953cf0f3fb22a2 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 10:09:35 +0100 Subject: [PATCH 3/7] Update contributing guidelines --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c857963..b6028c80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,3 +7,8 @@ When contributing to this SDK, please: - Maintain the existing minumum .NET framework/core support. - Keep PRs focused and change the minimum number of lines to achieve your goal. - Do not introduce breaking changes without prior discussion and approval. + + +### API documentation + +As the API documentation requires a windows environment, it is built and deployed by running the correspondig GitHub Actions Workflow. From b1621c4a53237af22bf4cf687dc89d08e99cbea5 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 10:12:39 +0100 Subject: [PATCH 4/7] revert --- .github/workflows/docs.yml | 80 ----------------------------------- .github/workflows/publish.yml | 35 +++++++++++++++ 2 files changed, 35 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 1d765e21..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Generate API docs - -on: - workflow_dispatch: - -permissions: - contents: read - -jobs: - generate-docs: - name: Generate API docs - runs-on: windows-latest - environment: 'release' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.event.inputs.branch }} - - - name: Install Java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - - - name: Install .NET - uses: actions/setup-dotnet@v3 - - - name: Install .NET Android and iOS workload - run: dotnet workload install android ios - - - name: Setup NuGet - uses: nuget/setup-nuget@v1 - - - name: Restore NuGet - run: nuget restore Auth0.OidcClient.All.sln - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.1 - - - name: Build - run: msbuild Auth0.OidcClient.All.sln -t:rebuild -verbosity:diag -property:Configuration=Release - - - name: Install DocFX - run: dotnet tool install -g docfx - - - name: Build docs - run: ./tools/build-docs.sh - shell: bash - - - uses: actions/upload-artifact@v3 - with: - name: docs - path: docs - - # Deploy job - deploy-docs: - # Add a dependency to the build job - needs: build - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - # Specify runner + deployment step - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action - with: - artifact_name: docs \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 33714bdd..9633edd7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,6 +48,18 @@ jobs: - name: Build run: msbuild Auth0.OidcClient.All.sln -t:rebuild -verbosity:diag -property:Configuration=Release + - name: Install DocFX + run: dotnet tool install -g docfx + + - name: Build docs + run: ./tools/build-docs.sh + shell: bash + + - uses: actions/upload-artifact@v3 + with: + name: docs + path: docs + - name: NuGet pack run: | nuget pack nuget/Auth0.OidcClient.Android.nuspec @@ -68,5 +80,28 @@ jobs: env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + # Deploy job + deploy-docs: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action + with: + artifact_name: docs From 82ebd3910202c55276cc3dc3bebf56c637245b70 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 10:13:40 +0100 Subject: [PATCH 5/7] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6028c80..21fd4cf4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,4 +11,4 @@ When contributing to this SDK, please: ### API documentation -As the API documentation requires a windows environment, it is built and deployed by running the correspondig GitHub Actions Workflow. +As the API documentation requires a windows environment, it is built and deployed automatically when running the release GitHub Actions workflow. From c16e71941c047f6a7b112c453d828612a316be68 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 10:14:36 +0100 Subject: [PATCH 6/7] Update .github/workflows/publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9633edd7..0a98823b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -83,7 +83,7 @@ jobs: # Deploy job deploy-docs: # Add a dependency to the build job - needs: build + needs: publish-nuget # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: From fe0cf3c612e84b87671227d1f80180ac0da90b15 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 18 Dec 2023 10:15:10 +0100 Subject: [PATCH 7/7] Update .github/workflows/publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a98823b..9ac436d3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -82,7 +82,7 @@ jobs: # Deploy job deploy-docs: - # Add a dependency to the build job + # Add a dependency to publish-nuget job needs: publish-nuget # Grant GITHUB_TOKEN the permissions required to make a Pages deployment