Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
chore: adds support for docs generation and publishing via github act…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
tanderson-ld committed Feb 20, 2024
1 parent 2895998 commit 0f95ae2
Show file tree
Hide file tree
Showing 17 changed files with 245 additions and 157 deletions.
13 changes: 13 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Use a step like this to build documentation.
name: Build Documentation
description: 'Build Documentation.'

runs:
using: composite
steps:
- name: Build Documentation
shell: bash
run: |
dotnet tool update -g docfx
docfx metadata
docfx build
5 changes: 5 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,8 @@ runs:
# cat test-run.log | tr -s ' ' | cut -d ' ' -f 1,2,7-
# if grep '\[FAIL\]' test-run.log >/dev/null; then exit 1; fi

# We build documentation during CI to ensure it can always build prior to a
# release.
- name: Build documentation
uses: ./.github/actions/build-docs

15 changes: 15 additions & 0 deletions .github/actions/publish-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish Documentation
description: 'Publish the documentation to Github pages'
inputs:
token:
description: 'Token to use for publishing.'
required: true

runs:
using: composite
steps:
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Publish to Github pages'
with:
docs_path: docs
github_token: ${{ inputs.token }} # For the shared action the token should be a GITHUB_TOKEN
21 changes: 21 additions & 0 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
workflow_dispatch:

name: Publish Docs
jobs:
build-publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Needed in this case to write github pages.
steps:
- uses: actions/checkout@v4
- id: build
name: Build and Test
uses: ./.github/actions/ci

- id: publish
name: Publish Documentation
uses: ./.github/actions/publish-docs
with:
token: ${{secrets.GITHUB_TOKEN}}
21 changes: 20 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,20 @@ jobs:
- name: Build
uses: ./.github/actions/build

- name: Retain artifacts for other jobs to use
- name: Retain build artifacts
uses: actions/upload-artifact@v3
with:
name: dir-bin-release
path: src/LaunchDarkly.ClientSdk/bin/Release/
retention-days: 1

- name: Retain docs artifacts
uses: actions/upload-artifact@v3
with:
name: dir-docs
path: docs/
retention-days: 1

# Signing DLLs is done on Ubuntu due to Digicert tooling compatibility
sign-dlls:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,6 +114,12 @@ jobs:
name: dir-bin-release-signed
path: src/LaunchDarkly.ClientSdk/bin/Release/

- name: Restore docs artifacts
uses: actions/download-artifact@v3
with:
name: dir-docs
path: docs/

- uses: launchdarkly/gh-actions/actions/[email protected]
name: Get secrets
with:
Expand All @@ -124,3 +137,9 @@ jobs:
name: unsigned-nupkg
path: nupkgs/
retention-days: 1

- uses: ./.github/actions/publish-docs
with:
# If publishing somewhere else, then get the token from SSM. If you need both github,
# and another token, then add more tokens to the composite action.
token: ${{secrets.GITHUB_TOKEN}}
46 changes: 46 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"metadata": [
{
"src": [
{
"src": "./src",
"files": [
"**/*.csproj",
"**/bin/**/**LaunchDarkly**.dll"
]
}
],
"dest": "./api",
"namespaceLayout": "nested"
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"docs/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"output": "docs",
"template": [
"default"
],
"globalMetadata": {
"_appName": "LaunchDarkly Dotnet Client SDK",
"_appTitle": "LaunchDarkly Dotnet Client SDK",
"_enableSearch": true,
"pdf": false
}
}
}
14 changes: 0 additions & 14 deletions docs-src/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs-src/index.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs-src/namespaces/LaunchDarkly.Sdk.Client.Integrations.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs-src/namespaces/LaunchDarkly.Sdk.Client.Interfaces.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs-src/namespaces/LaunchDarkly.Sdk.Client.Subsystems.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs-src/namespaces/LaunchDarkly.Sdk.Client.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs-src/namespaces/LaunchDarkly.Sdk.Json.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs-src/namespaces/LaunchDarkly.Sdk.md

This file was deleted.

11 changes: 11 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
_layout: landing
---

# LaunchDarkly Client-Side SDK for .NET

For first time users, visit our [LaunchDarkly Docs](https://docs.launchdarkly.com/sdk/client-side/dotnet) page. Within these docs, the [LDClient](api/LaunchDarkly.Sdk.Client.LdClient.html) and the [ContextBuilder](api/LaunchDarkly.Sdk.ContextBuilder.html) are good starting points to explore from.

This site contains the full API reference for the [`LaunchDarkly.ClientSdk`](https://www.nuget.org/packages/LaunchDarkly.ClientSdk) package, as well other packages used by the client package.

For source code, see the [GitHub repository](https://github.com/launchdarkly/dotnet-client-sdk). The [developer notes](https://github.com/launchdarkly/dotnet-client-sdk/blob/main/CONTRIBUTING.md) there include links to other repositories used in the SDK.
Loading

0 comments on commit 0f95ae2

Please sign in to comment.