-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update workflow with docfx generation
- Loading branch information
1 parent
169d30c
commit 9297ad5
Showing
1 changed file
with
57 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Nuget Publish | ||
name: Build and Publish | ||
|
||
on: | ||
push: | ||
|
@@ -22,23 +22,36 @@ on: | |
dotnet-version: | ||
description: ".NET version to use" | ||
required: false | ||
default: "6.0.x" | ||
default: "8.0.x" | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
checks: write | ||
id-token: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
env: | ||
DOTNET_VERSION: ${{ github.event.inputs.dotnet-version || '6.0.x' }} | ||
PACKAGE_VERSION: '' | ||
DOTNET_VERSION: ${{ github.event.inputs.dotnet-version || '8.0.x' }} | ||
|
||
jobs: | ||
build: | ||
if: ${{ !github.event_name == 'pull_request' || !github.event.pull_request.draft }} | ||
env: | ||
PACKAGE_VERSION: '' | ||
COVERAGE_FILE_PATH: '' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-dotnet@v3 | ||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
|
@@ -61,11 +74,18 @@ jobs: | |
report_individual_runs: true | ||
compare_to_earlier_commit: false | ||
|
||
- name: Determine Coverage File Path | ||
if: ${{ github.ref != 'refs/heads/main' && github.event_name != 'push' && always() }} | ||
shell: bash | ||
run: | | ||
COVERAGE_FILE_PATH=$(find ./test-results -name 'coverage.cobertura.xml' | head -n 1) | ||
echo "COVERAGE_FILE_PATH=$COVERAGE_FILE_PATH" >> $GITHUB_ENV | ||
- name: Code Coverage Summary Report | ||
if: ${{ github.ref != 'refs/heads/main' && github.event_name != 'push' && always() }} | ||
uses: irongut/[email protected] | ||
with: | ||
filename: test-results/**/coverage.cobertura.xml | ||
filename: ${{ env.COVERAGE_FILE_PATH }} | ||
badge: true | ||
format: 'markdown' | ||
output: 'both' | ||
|
@@ -114,7 +134,7 @@ jobs: | |
echo "PACKAGE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
shell: pwsh | ||
|
||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ElevenLabs-DotNet.${{ env.PACKAGE_VERSION }} | ||
|
@@ -124,3 +144,33 @@ jobs: | |
${{ github.workspace }}/ElevenLabs-DotNet/bin/Release/ElevenLabs-DotNet-Proxy.${{ env.PACKAGE_VERSION }}.nupkg | ||
${{ github.workspace }}/ElevenLabs-DotNet/bin/Release/ElevenLabs-DotNet-Proxy.${{ env.PACKAGE_VERSION }}.symbols.nupkg | ||
if-no-files-found: ignore | ||
|
||
docs: | ||
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | ||
needs: build | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: build docfx | ||
run: | | ||
dotnet tool update -g docfx | ||
docfx .docs/docfx.json | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: '_site' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/[email protected] |