Skip to content

Commit

Permalink
Add docfx workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rdipardo committed Sep 23, 2024
1 parent d1ab3e3 commit 7b6f171
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 7 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: Public Domain
# SPDX-License-Identifier: CC0-1.0

name: API Docs

on:
push:
paths:
- 'lib/**/*.cs'
- 'docfx.json'
- '.github/workflows/docfx.yml'

permissions:
actions: read
pages: write
id-token: write

jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Generate docs
run: |
dotnet tool update -g docfx
dotnet restore
docfx
env:
DOCFX_SOURCE_BRANCH_NAME: ${{ github.ref_name }}

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './_site'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ DocProject/Help/html
publish/

# Publish Web Output
**/api/
_site/
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
Expand Down
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-FileCopyrightText = "2004 Apache Software Foundation"
SPDX-License-Identifier = "Apache-2.0"

[[annotations]]
path = ["**.json", "doc/**", "lib/**.png", "**/CODEOWNERS", "README**", "NOTICE**"]
path = ["**.json", "doc/**", "lib/**.md", "lib/**.png", "lib/**.yml", "**/CODEOWNERS", "README**", "NOTICE**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "Public Domain"
SPDX-License-Identifier = "CC0-1.0"
Expand Down
54 changes: 54 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"metadata": [
{
"src": [
{
"src": "lib",
"files": [
"**/*.csproj"
]
}
],
"dest": "lib/api",
"properties": {
"TargetFramework": "net481",
"DefineConstants": "SCI_DISABLE_PROVISIONAL"
}
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"src": "lib",
"dest": "." ,
"exclude": [
"_site/**"
]
}
],
"resource": [
{
"files": [
"lib/*.{ico,png,svg}"
]
}
],
"output": "_site",
"template": [
"statictoc",
"modern"
],
"globalMetadata": {
"_appFaviconPath": "lib/brand.png",
"_appName": "Npp.DotNet.Plugin",
"_appTitle": "Npp.DotNet.Plugin",
"_enableSearch": true,
"_disableContribution": true,
"pdf": false
}
},
"disableGitFeatures": true
}
2 changes: 1 addition & 1 deletion lib/Npp.DotNet.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Description>AOT-ready port of the .NET Framework plugin template for Notepad++</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>brand.png</PackageIcon>
<PackageProjectUrl>https://github.com/npp-dotnet</PackageProjectUrl>
<PackageProjectUrl>https://npp-dotnet.github.io/Npp.DotNet.Plugin</PackageProjectUrl>
<RepositoryUrl>https://github.com/npp-dotnet/npp.dotnet.plugin</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Expand Down
2 changes: 0 additions & 2 deletions lib/README.md.license

This file was deleted.

3 changes: 3 additions & 0 deletions lib/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
redirect_url: /api/Npp.DotNet.Plugin.html
---
5 changes: 5 additions & 0 deletions lib/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Home
href: README.md

- name: API
href: api/
6 changes: 3 additions & 3 deletions test/Memory/Memory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<ItemGroup>
<PackageReference Include="AsmResolver.DotNet" Version="5.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 7b6f171

Please sign in to comment.