Skip to content

Commit 2ee7f2e

Browse files
committed
Fix cross-platform duplicate .well-known path handling
1 parent f5e38cf commit 2ee7f2e

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ on:
99
jobs:
1010
build:
1111
name: Build and Test
12-
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
runs-on: ${{ matrix.os }}
1316
steps:
1417
- uses: actions/checkout@v6
1518
- uses: actions/setup-java@v5
@@ -22,7 +25,7 @@ jobs:
2225
scala-cli-version: 1.12.2
2326
- run: scala-cli fmt --check .
2427
- run: scala-cli --server=false build.scala
25-
- if: github.event_name != 'pull_request'
28+
- if: matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request'
2629
uses: peaceiris/actions-gh-pages@v4.0.0
2730
with:
2831
github_token: ${{ secrets.GITHUB_TOKEN }}

build.scala

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ object LaikaBuild {
8686
).toURL()
8787

8888
InputTree[IO]
89+
// Exclude `.well-known` from the main `src` scan to avoid duplicates; it is added explicitly below for consistent cross-platform behavior.
90+
.withFileFilter(FileFilter.lift(_.name == ".well-known"))
8991
.addDirectory("src")
90-
// Laika skips .dotfiles by default
9192
.addDirectory("src/.well-known", Path.Root / ".well-known")
9293
.addInputStream(
9394
IO.blocking(securityPolicy.openStream()),
@@ -364,12 +365,12 @@ object LaikaCustomizations {
364365
output.resource.use { os =>
365366
Async[F].blocking {
366367
val pw = new java.io.PrintWriter(os)
367-
pw.print("""|<?xml version="1.0" encoding="UTF-8" ?>
368-
|<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
369-
|<channel>
370-
|<title>Typelevel Blog</title>
371-
|<link>https://typelevel.org/blog/</link>
372-
|<description>The Typelevel Blog RSS Feed</description>
368+
pw.print("""|<?xml version="1.0" encoding="UTF-8" ?>
369+
|<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
370+
|<channel>
371+
|<title>Typelevel Blog</title>
372+
|<link>https://typelevel.org/blog/</link>
373+
|<description>The Typelevel Blog RSS Feed</description>
373374
|""".stripMargin)
374375

375376
posts
@@ -378,8 +379,8 @@ object LaikaCustomizations {
378379
pw.print(doc.content)
379380
}
380381

381-
pw.print("""|</channel>
382-
|</rss>
382+
pw.print("""|</channel>
383+
|</rss>
383384
|""".stripMargin)
384385
pw.flush()
385386
}

0 commit comments

Comments
 (0)