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

Commit

Permalink
new docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy D. Miller authored and Jeremy D. Miller committed Jun 17, 2022
1 parent b3ea4d7 commit 4c67c25
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 10 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,32 @@
name: Publish docs

on: [workflow_dispatch]

jobs:
publish_docs_job:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 15.x

- name: Build & Deploy docs
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: ./build.sh --no-color publish-docs-gh-actions

- name: Generate Algolia DocSearch index
uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: ${{ secrets.ALGOLIA_APPLICATION_ID }}
algolia_api_key: ${{ secrets.ALGOLIA_API_KEY }}
file: 'docs/.vitepress/algolia-config.json'
4 changes: 2 additions & 2 deletions build.cmd
@@ -1,11 +1,11 @@
@echo off
FOR /f %%v IN ('dotnet --version') DO set version=%%v
set target_framework=
IF "%version:~0,2%"=="6." (set target_framework=net5.0)
IF "%version:~0,2%"=="6." (set target_framework=net6.0)

IF [%target_framework%]==[] (
echo "BUILD FAILURE: .NET 6 SDK required to run build"
exit /b 1
)

dotnet run -p build/build.csproj -f %target_framework% -c Release -- %*
dotnet run --project build/build.csproj -f %target_framework% -c Release -- %*
11 changes: 4 additions & 7 deletions build.ps1
@@ -1,13 +1,10 @@
$ErrorActionPreference = "Stop";
$version = dotnet --version;
if ($version.StartsWith("3.1")) {
$target_framework="netcoreapp3.1"
}
elseif ($version.StartsWith("5.")) {
$target_framework="net5.0"
if ($version.StartsWith("6.")) {
$target_framework="net6.0"
} else {
Write-Output "BUILD FAILURE: .NET Core 3.1 or .NET 5 SDK required to run build"
Write-Output "BUILD FAILURE: .NET 6 SDK required to run build"
exit 1
}

dotnet run -p build/build.csproj -f $target_framework -c Release -- $args
dotnet run --project build/build.csproj -f $target_framework -c Release -- $args
2 changes: 1 addition & 1 deletion build.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail

dotnet run -p build/build.csproj -c Release -- "$@"
dotnet run --project build/build.csproj -c Release -- "$@"
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 4c67c25

Please sign in to comment.