Skip to content

Commit

Permalink
Remove fsdoc from local tool cache
Browse files Browse the repository at this point in the history
Relieves the growing pains of .NET 6 (*)

 ---
 (*) fsprojects/FSharp.Formatting#719
  • Loading branch information
rdipardo committed Mar 14, 2022
1 parent 18cd13b commit c12b85f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 67 deletions.
6 changes: 0 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
jobs:
package:
runs-on: windows-latest
defaults:
run:
shell: powershell
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Expand All @@ -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
Expand All @@ -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/[email protected]
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-
Expand All @@ -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
Expand Down
21 changes: 0 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -49,12 +36,6 @@ Run tests with:
scripts/ci live
~~~

Browse docs with:

~~~sh
scripts/gendocs live
~~~


### Pull Requests

Expand Down Expand Up @@ -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:[email protected]
[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/
26 changes: 17 additions & 9 deletions scripts/gendocs
Original file line number Diff line number Diff line change
@@ -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} \
Expand Down
26 changes: 0 additions & 26 deletions scripts/gendocs.cmd

This file was deleted.

0 comments on commit c12b85f

Please sign in to comment.