diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 45145a6..28a3a43 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,12 +2,6 @@ "version": 1, "isRoot": true, "tools": { - "fsharp.formatting.commandtool": { - "version": "11.1.0", - "commands": [ - "fsdocs" - ] - }, "fantomas-tool": { "version": "4.4.0", "commands": [ diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 7d155e3..1d92858 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -6,6 +6,9 @@ on: jobs: package: runs-on: windows-latest + defaults: + run: + shell: powershell env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true @@ -17,13 +20,17 @@ jobs: - name: Pre-build Install uses: actions/setup-dotnet@v2 with: - dotnet-version: '5.0.301' + dotnet-version: '6.0.200' - name: Build package run: scripts\pack + - name: Collect release info + run: | + $REL=${env:GITHUB_REF}.Split('/')[2] + echo "RELEASE_VERSION=$REL" >> $env:GITHUB_ENV - name: Save package uses: actions/upload-artifact@v3 with: - name: Fornax.Seo.nupkg + name: Fornax.Seo.${{ env.RELEASE_VERSION }}.nupkg path: ${{ github.workspace }}/release/*.nupkg retention-days: 30 if-no-files-found: error @@ -42,11 +49,16 @@ jobs: - name: Pre-build Install uses: actions/setup-dotnet@v2 with: - dotnet-version: '5.0.204' + dotnet-version: '5.0.406' - name: Cache packages uses: actions/cache@v2.1.7 with: - path: ~/.nuget/packages + path: | + ~/.nuget/packages + ${{ github.workspace }}/src/Fornax/.paket + ${{ github.workspace }}/src/Fornax/paket-files + ${{ github.workspace }}/src/FSharp.Data/.paket + ${{ github.workspace }}/src/FSharp.Data/paket-files key: ${{ runner.os }}-nuget-${{ hashFiles('src/Fornax.Seo/Directory.Build.props') }} restore-keys: |- ${{ runner.os }}-nuget- @@ -59,7 +71,7 @@ jobs: uses: actions/download-artifact@v3 id: fetch with: - name: Fornax.Seo.nupkg + name: Fornax.Seo.${{ env.RELEASE_VERSION }}.nupkg path: ${{ github.workspace }}/release - name: Prepare release uses: ncipollo/release-action@v1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a61fb0..911c4f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,13 +14,6 @@ If you already have the source tree locally, run _All platforms need a .NET SDK at version 6.0.100 or later_ -> **NOTE** -> -> .NET SDK 5.0.300 and later [may be incompatible][] with `fsdocs` -> -> Run `dotnet --list-sdks` and `dotnet --version` before trying to build -> the project's documentation - #### Windows @@ -32,12 +25,6 @@ To run unit tests and build a sample website: scripts\ci live ~~~ -To browse a local copy of [the documentation][]: - -~~~bat - scripts\gendocs live -~~~ - #### Linux, macOS @@ -49,12 +36,6 @@ Run tests with: scripts/ci live ~~~ -Browse docs with: - -~~~sh - scripts/gendocs live -~~~ - ### Pull Requests @@ -106,10 +87,8 @@ put a [license notice][] at the top, like this: ~~~ -[may be incompatible]: https://github.com/ArtemyB/FsDocsSample/issues/1#issuecomment-878835846 [well-documented steps]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork [the issue tracker]: https://github.com/rdipardo/Fornax.Seo/issues [the project owner]: mailto:dipardo.r@gmail.com -[the documentation]: https://heredocs.io/Fornax.Seo [Mozilla Public License, Version 2.0]: https://www.mozilla.org/en-US/MPL/2.0/ [license notice]: https://www.mozilla.org/en-US/MPL/headers/ diff --git a/scripts/gendocs b/scripts/gendocs index 313d77f..297dd72 100755 --- a/scripts/gendocs +++ b/scripts/gendocs @@ -1,17 +1,25 @@ #!/usr/bin/env bash -FORNAX_CMD=build -SITE_ROOT='root /' -if [ ! -z "$CI" ]; then - SITE_ROOT='root https://heredocs.io/Fornax.Seo/' -elif [ "$1" = "live" ]; then - FORNAX_CMD=watch - SITE_ROOT= + +if [ -z "$GITHUB_REF" ]; then + echo '********************************************************************' + echo 'This script must be deployed to GitHub Actions from a tagged commit!' + echo '********************************************************************' + exit 2 fi -dotnet tool restore + +# +# .NET 6 compatibility remains a work in progress +# https://github.com/fsprojects/FSharp.Formatting/pull/719 +# +git checkout -f e8653a7 -- src/Fornax.Seo/Directory.Build.props +sed -i 's/[0-9.]\+/5.0.204/' global.json +sed -i 's/\-f v\$(/-f \$(/' src/Fornax.Seo/Fornax.Seo.fsproj +dotnet tool install fsdocs-tool --version 14.0.1 dotnet build /v:m /p:nowarn='"3218;3390"' src/Fornax.Seo/Fornax.Seo.fsproj -c Release cp ./README.md docs/index.md -dotnet fsdocs $FORNAX_CMD --projects $(pwd)/src/Fornax.Seo/Fornax.Seo.fsproj \ +SITE_ROOT='root https://heredocs.io/Fornax.Seo/' \ +dotnet fsdocs build --projects $(pwd)/src/Fornax.Seo/Fornax.Seo.fsproj \ --eval --clean --strict \ --properties RepositoryBranch=main Configuration=Release \ --parameters ${SITE_ROOT} \ diff --git a/scripts/gendocs.cmd b/scripts/gendocs.cmd deleted file mode 100644 index dec216f..0000000 --- a/scripts/gendocs.cmd +++ /dev/null @@ -1,26 +0,0 @@ -@echo off -SETLOCAL -SET "FSDOCS_CMD=build" -SET "SITE_ROOT=root /" -IF NOT "%CI%"=="" ( - SET "SITE_ROOT=root https://heredocs.io/Fornax.Seo/" -) -IF "%1"=="live" ( - SET "FSDOCS_CMD=watch" - SET SITE_ROOT= -) -dotnet tool restore -dotnet build /v:m /p:nowarn=\"3218;3390\" src/Fornax.Seo/Fornax.Seo.fsproj -c Release - -copy README.md docs\index.md -dotnet fsdocs %FSDOCS_CMD% --projects %CD%/src/Fornax.Seo/Fornax.Seo.fsproj ^ - --eval --clean --strict ^ - --properties RepositoryBranch=main Configuration=Release ^ - --parameters %SITE_ROOT% ^ - fsdocs-logo-link https://www.nuget.org/packages/Fornax.Seo ^ - fsdocs-repository-link https://github.com/rdipardo/Fornax.Seo ^ - fsdocs-license-link https://github.com/rdipardo/Fornax.Seo/blob/main/LICENSE ^ - fsdocs-release-notes-link https://github.com/rdipardo/Fornax.Seo/blob/main/CHANGELOG.md - -del docs\index.md -ENDLOCAL