diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d820679..bbc680a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,13 +22,20 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-24.04 + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 + NUGET_PACKAGES: ${{ github.workspace }}/.github/nuget-packages steps: - name: Check out the sources uses: actions/checkout@v6 - name: Set up .NET SDK uses: actions/setup-dotnet@v5 + - name: Cache NuGet packages + uses: actions/cache@v5 with: - dotnet-version: 8.x + key: ${{ runner.os }}.nuget.${{ hashFiles('**/*.*proj', '**/*.props') }} + path: ${{ env.NUGET_PACKAGES }} - run: dotnet tool restore - run: dotnet docfx docs/docfx.json - name: Upload artifact diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c85c42c..aa59641 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,9 +22,20 @@ jobs: permissions: contents: write runs-on: ubuntu-24.04 + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 + NUGET_PACKAGES: ${{ github.workspace }}/.github/nuget-packages steps: - name: Check out the sources uses: actions/checkout@v6 + - name: Set up .NET SDK + uses: actions/setup-dotnet@v5 + - name: Cache NuGet packages + uses: actions/cache@v5 + with: + key: ${{ runner.os }}.nuget.${{ hashFiles('**/*.*proj', '**/*.props') }} + path: ${{ env.NUGET_PACKAGES }} - id: version name: Get version shell: pwsh diff --git a/scripts/github-actions.fsx b/scripts/github-actions.fsx index b11ab63..d5d0ae7 100644 --- a/scripts/github-actions.fsx +++ b/scripts/github-actions.fsx @@ -120,9 +120,8 @@ let workflows = [ name "Release" yield! mainTriggers onPushTags "v*" - job "nuget" [ + dotNetJob "nuget" [ runsOn ubuntu - checkOut jobPermission(PermissionKind.Contents, AccessKind.Write) let configuration = "Release" @@ -200,17 +199,9 @@ let workflows = [ group = "pages", cancelInProgress = false ) - job "publish-docs" [ + dotNetJob "publish-docs" [ environment(name = "github-pages", url = "${{ steps.deployment.outputs.page_url }}") runsOn "ubuntu-24.04" - checkOut - step( - name = "Set up .NET SDK", - usesSpec = Auto "actions/setup-dotnet", - options = Map.ofList [ - "dotnet-version", "8.x" - ] - ) step( run = "dotnet tool restore" )