From b50adcfd445f7cd4e12466eb04848763abe8a37d Mon Sep 17 00:00:00 2001 From: Joe Fabisevich Date: Thu, 25 Jun 2026 14:37:26 -0400 Subject: [PATCH] Updating CI for docc docs --- .github/workflows/ci.yml | 22 +++++++++++++ .github/workflows/documentation.yml | 51 +++++++++++++++++++++++++++++ .gitignore | 1 + .spi.yml | 5 +++ Package.swift | 3 +- 5 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/documentation.yml create mode 100644 .spi.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d8908e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + test: + name: Test + runs-on: macos-15 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Print Swift version + run: swift --version + - name: Run tests + run: swift test + - name: Validate documentation + run: swift package generate-documentation --target Broadcast diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..e8fa4ba --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,51 @@ +name: Documentation + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + documentation: + name: Generate and publish documentation + runs-on: macos-15 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Print Swift version + run: swift --version + + - name: Generate documentation + uses: fwcd/swift-docc-action@v1 + with: + target: Broadcast + output: ./docs + hosting-base-path: Broadcast + disable-indexing: 'true' + transform-for-static-hosting: 'true' + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload documentation artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitignore b/.gitignore index bbc1ae6..4fcc8fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .build/ +.docc-build/ .swiftpm/ Package.resolved xcuserdata/ diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 0000000..ddba3a7 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,5 @@ +version: 1 +builder: + configs: + - platform: ios + documentation_targets: [Broadcast] diff --git a/Package.swift b/Package.swift index 49be672..85e0f26 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,8 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/mergesort/Boutique", from: Version(3, 0, 2)) + .package(url: "https://github.com/mergesort/Boutique", from: Version(3, 0, 2)), + .package(url: "https://github.com/apple/swift-docc-plugin", from: Version(1, 0, 0)) ], targets: [ .target( -- 2.51.2