From 37aa0ef713c9a3706a9442e4d08028ca3176551c Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" Date: Thu, 12 Mar 2026 16:07:50 +0100 Subject: [PATCH] Add GitHub workflow file to generate docs --- .github/workflows/docs.yml | 61 +++++++++++++++++++++++++++++ .github/workflows/index.tpl.html | 66 ++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/index.tpl.html diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..226d478 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,61 @@ +name: Docs + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + - name: Set up Pages + uses: actions/configure-pages@v5 + - name: Set up Swift + uses: swift-actions/setup-swift@v3 + with: + skip-verify-signature: true + - name: Generate Docs + run: | + swift package add-dependency --from 1.4.0 "https://github.com/apple/swift-docc-plugin.git" + for target in Inotify TaskCLI; do + lower="${target,,}" + mkdir -p "./public/$lower" + swift package --allow-writing-to-directory "./public/$lower" \ + generate-documentation --disable-indexing --transform-for-static-hosting \ + --target "$target" \ + --hosting-base-path "swift-inotify/$lower" \ + --output-path "./public/$lower" + done + - name: Copy Index Page + run: | + cp ./.github/workflows/index.tpl.html public/index.html + sed -i -e 's/{{project.name}}/Swift Inotify/g' public/index.html + sed -i -e 's/{{project.tagline}}/🗂️ Monitor filesystem events on Linux using modern Swift concurrency/g' public/index.html + sed -i -e 's|{{project.links}}|
  • Inotify: The actual library.
  • TaskCLI: The project build command.
  • |g' public/index.html + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: ./public + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: docs + steps: + - name: Deploy Docs + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/index.tpl.html b/.github/workflows/index.tpl.html new file mode 100644 index 0000000..6b7d1fa --- /dev/null +++ b/.github/workflows/index.tpl.html @@ -0,0 +1,66 @@ + + + + Astzweig | Swift Inotify + + + + + + +
    + Astzweig Mechanizer Logo +
    +

    {{project.name}}

    +

    {{project.tagline}}

    +
    +

    Documentations

    + +
    + + +