Skip to content

Commit f0bc9e0

Browse files
committed
fix: update GitHub Actions workflow for DocFX build and adjust project configuration (temp)
1 parent bfdaca7 commit f0bc9e0

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@ name: Build
1818
on:
1919
push:
2020
branches:
21-
- "main"
22-
- "develop"
21+
- 'main'
22+
- 'develop'
2323
paths:
24-
- "**.h"
25-
- "**.c"
26-
- "**.cs"
27-
- "**.csproj"
28-
- "**.sln"
29-
- ".github/workflows/build.yml"
24+
- '**.h'
25+
- '**.c'
26+
- '**.cs'
27+
- '**.csproj'
28+
- '**.sln'
29+
- '.github/workflows/build.yml'
3030

3131
workflow_dispatch:
3232
inputs:
3333
push-to-dev:
34-
description: "Push to internal NuGet"
34+
description: 'Push to internal NuGet'
3535
required: false
3636
default: false
3737
type: boolean
3838
version:
39-
description: "Version"
39+
description: 'Version'
4040
required: false
4141
default: "0.0.0-prerelease.YYYYMMDD.B"
4242
type: string
4343
schedule:
44-
- cron: "0 0 * * *" # Every day at midnight
45-
44+
- cron: '0 0 * * *' # Every day at midnight
45+
4646
jobs:
4747
run-tests:
4848
name: Run tests
@@ -82,15 +82,16 @@ jobs:
8282
$versionProp.Project.PropertyGroup.YubicoYubiKeyVersion = "${{ github.event.inputs.version }}"
8383
$versionProp.Save($file.FullName)
8484
85-
# Install DocFX
86-
- name: Install DocFX
87-
run: |
88-
dotnet tool install --global docfx --version 2.78.2
89-
9085
# Build the project
9186
- name: Build Yubico.NET.SDK.sln
92-
run:
93-
dotnet pack --configuration Release --nologo --verbosity minimal Yubico.NET.SDK.sln
87+
run: dotnet pack --configuration Release --nologo --verbosity minimal Yubico.NET.SDK.sln
88+
89+
# Build the documentation
90+
- name: Build docs
91+
run: |
92+
dotnet tool install --global docfx --version 2.78.2
93+
docfx --version
94+
docfx Yubico.YubiKey/src/docfx.json --logLevel warning --log Yubico.YubiKey/docs/log.txt --warningsAsErrors
9495
9596
# Upload documentation
9697
- name: "Save build artifacts: Docs"
@@ -99,7 +100,7 @@ jobs:
99100
name: Documentation
100101
path: Yubico.YubiKey/docs/_site/
101102
if-no-files-found: error
102-
103+
103104
# Upload NuGet packages
104105
- name: "Save build artifacts: Nuget Packages"
105106
uses: actions/upload-artifact@v4
@@ -109,7 +110,7 @@ jobs:
109110
Yubico.Core/src/bin/Release/*.nupkg
110111
Yubico.YubiKey/src/bin/Release/*.nupkg
111112
if-no-files-found: error
112-
113+
113114
# Upload symbols
114115
- name: "Save build artifacts: Symbols Packages"
115116
uses: actions/upload-artifact@v4
@@ -119,7 +120,7 @@ jobs:
119120
Yubico.Core/src/bin/Release/*.snupkg
120121
Yubico.YubiKey/src/bin/Release/*.snupkg
121122
if-no-files-found: error
122-
123+
123124
# Upload assemblies
124125
- name: "Save build artifacts: Assemblies"
125126
uses: actions/upload-artifact@v4
@@ -129,7 +130,7 @@ jobs:
129130
Yubico.Core/src/bin/Release/**/*.dll
130131
Yubico.YubiKey/src/bin/Release/**/*.dll
131132
if-no-files-found: error
132-
133+
133134
# Generate artifact attestation
134135
- name: Generate artifact attestation
135136
uses: actions/attest-build-provenance@v2
@@ -141,7 +142,7 @@ jobs:
141142
Yubico.YubiKey/src/bin/Release/*.snupkg
142143
Yubico.Core/src/bin/Release/**/*.dll
143144
Yubico.YubiKey/src/bin/Release/**/*.dll
144-
145+
145146
upload-docs:
146147
name: Upload docs
147148
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'

Yubico.YubiKey/src/Yubico.YubiKey.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ limitations under the License. -->
163163
<Error Condition="'$(DocFXExists)' != '0'" Text="DocFX is not installed. Please install it using: dotnet tool install --global docfx" />
164164
</Target>
165165

166-
<Target Name="DocFXBuild" AfterTargets="Build" DependsOnTargets="CheckDocFX" Condition="'$(Configuration)' == 'Release'">
166+
<Target Name="DocFXBuild" AfterTargets="Build" DependsOnTargets="CheckDocFX" Condition="'$(Configuration)' == 'ReleaseWithDocs'">
167167
<Exec Command="docfx build $(MSBuildProjectDirectory)/docfx.json --logLevel warning --log docfx-log.txt --warningsAsErrors" IgnoreExitCode="true">
168168
<Output TaskParameter="ExitCode" PropertyName="DocFXExitCode" />
169169
</Exec>

0 commit comments

Comments
 (0)