Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rdipardo committed Jan 3, 2024
1 parent 4cd53b7 commit da0c54a
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 35 deletions.
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
version: 2
updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
target-branch: "next"
commit-message:
prefix: third-party
labels:
- "upstream"
- package-ecosystem: "nuget"
directory: "/src/Fornax.Seo"
ignore:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
unit_tests:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
DOTNET_NOLOGO: true
Expand All @@ -24,17 +24,15 @@ jobs:
submodules: 'recursive'
fetch-depth: 0
- name: Pre-test install
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Cache packages
uses: actions/cache@v3
with:
path: |-
${{ github.workspace }}/.paket
${{ github.workspace }}/src/FSharp.Data/.paket
${{ github.workspace }}/src/FSharp.Data/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('src/Fornax.Seo/Directory.Build.props') }}
key: ${{ runner.os }}-nuget-${{ hashFiles('src/Fornax.Seo/Fornax.Seo.fsproj') }}
restore-keys: |-
${{ runner.os }}-nuget-
${{ runner.os }}-
Expand Down
11 changes: 6 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
permissions:
actions: read
contents: write
defaults:
run:
shell: cmd
Expand All @@ -18,7 +21,7 @@ jobs:
submodules: 'recursive'
fetch-depth: 0
- name: Pre-build Install
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Cache packages
Expand All @@ -27,9 +30,7 @@ jobs:
path: |
~/.nuget/packages
${{ github.workspace }}/.paket
${{ github.workspace }}/src/FSharp.Data/.paket
${{ github.workspace }}/src/FSharp.Data/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('src/Fornax.Seo/Directory.Build.props') }}
key: ${{ runner.os }}-nuget-${{ hashFiles('src/Fornax.Seo/Fornax.Seo.fsproj') }}
restore-keys: |-
${{ runner.os }}-nuget-
${{ runner.os }}-
Expand All @@ -45,7 +46,7 @@ jobs:
.\scripts\changelog.ps1 | Out-File release_notes.txt -Encoding utf8
shell: powershell
- name: Save package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Fornax.Seo.${{ env.RELEASE_VERSION }}.nupkg
path: ${{ github.workspace }}/release/*.nupkg
Expand Down
2 changes: 1 addition & 1 deletion example/Fornax.Seo.Example/Fornax.Seo.Example.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<ProjectReference Include="../../src/Fornax.Seo/Fornax.Seo.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Markdig" Version="0.33.0" />
<PackageReference Include="Markdig" Version="0.34.0" />
</ItemGroup>
</Project>
11 changes: 8 additions & 3 deletions example/Fornax.Seo.Example/config.fsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#r "_lib/Fornax.Core.dll"
#load "loaders/globalloader.fsx"
#load "loaders/globalloader.fsx"

open Config
open System.IO

let hasChanged (assetPath: string) =
(not <| File.Exists($@"_public\{assetPath}")) ||
(File.GetLastWriteTime(assetPath) > File.GetLastWriteTime($@"_public\{assetPath}"))

let postPredicate (projectRoot: string, page: string) =
let ext = Path.GetExtension page
page.StartsWith("posts") && List.contains ext Globalloader.contentFileTypes
page.StartsWith("posts") && List.contains ext Globalloader.contentFileTypes

let staticPredicate (projectRoot: string, page: string) =
let ext = Path.GetExtension page
let fileShouldBeExcluded =
List.contains ext (Globalloader.ignoredFileTypes @ Globalloader.contentFileTypes) ||
hasChanged page |> not ||
List.contains ext (Globalloader.ignoredFileTypes @ Globalloader.contentFileTypes) ||
page.Contains "_public" ||
page.Contains "_bin" ||
page.Contains "_lib" ||
Expand Down
10 changes: 5 additions & 5 deletions example/Fornax.Seo.Example/loaders/globalloader.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ type SiteInfo = {
postPageSize: int
}

let contentFileTypes = [".md"; ".markdown"]
let ignoredFileTypes = [ ".fsx"; ".fsproj"; ".json"; ".rst"; ".yml"; ".sh"; ".cmd" ]

let contentFileTypes = [".md"; ".markdown"]
let ignoredFileTypes = [ ".fsx"; ".fsproj"; ".json"; ".rst"; ".yml"; ".sh"; ".cmd" ]

let loader (projectRoot: string) (siteContent: SiteContents) =
let siteInfo =
{ title = "Sample Fornax blog"
Expand All @@ -21,10 +21,10 @@ let loader (projectRoot: string) (siteContent: SiteContents) =
postPageSize = 3 }

let onTheWeb =
[ "asciinema.org/~rdipardo"
[ "asciinema.org/~rdipardo"
"github.com/rdipardo"
"bitbucket.org/rdipardo"
"sourceforge.net/u/robertdipardo/profile/" ]
"sourceforge.net/u/robertdipardo/profile/" ]

let siteAuthor = { Name = "rdipardo"; Email = "dipardo.r@gmail.com"; SocialMedia = onTheWeb }

Expand Down
6 changes: 3 additions & 3 deletions example/Fornax.Seo.Example/loaders/postloader.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#r "../_lib/Markdig.dll"

open Markdig
open System.IO
open System.IO

type PostConfig = {
disableLiveRefresh: bool
Expand Down Expand Up @@ -118,8 +118,8 @@ let loadFile n =

let loader (projectRoot: string) (siteContent: SiteContents) =
let postsPath = System.IO.Path.Combine(projectRoot, contentDir)
Directory.GetFiles postsPath
|> Array.filter (fun n -> List.contains (Path.GetExtension n) Globalloader.contentFileTypes)
Directory.GetFiles postsPath
|> Array.filter (fun n -> List.contains (Path.GetExtension n) Globalloader.contentFileTypes)
|> Array.map loadFile
|> Array.iter (fun p -> siteContent.Add p)

Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
{
"sdk": {
"version": "6.0.100",
"rollForward": "latestFeature"
}
"rollForward": "latestFeature"
}
}

0 comments on commit da0c54a

Please sign in to comment.