From bfd14a9775b79a20bcc2e7c4ff30ca1a16d2a8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Stompo=CC=81r?= Date: Sat, 27 Dec 2025 22:21:24 +0100 Subject: [PATCH 1/2] Upload online docs --- .github/workflows/archive.yml | 73 +++++++++++++++++++++++++++++++++++ Auxilary/index.html | 14 +++++++ Package.swift | 4 ++ 3 files changed, 91 insertions(+) create mode 100644 .github/workflows/archive.yml create mode 100644 Auxilary/index.html diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml new file mode 100644 index 0000000..4b73e49 --- /dev/null +++ b/.github/workflows/archive.yml @@ -0,0 +1,73 @@ +--- +name: Archive + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + tests: + uses: ./.github/workflows/tests.yml + documentation: + needs: tests + runs-on: macOS-latest + steps: + - name: Check Out Sources + uses: actions/checkout@v2 + with: + submodules: true + - name: Build the project + run: swift package generate-documentation -o /tmp/PNDependencyGraph.doccarchive + - name: Archive the documentation directory + working-directory: /tmp + run: tar -czf PNDependencyGraph.doccarchive.tar.gz PNDependencyGraph.doccarchive + - name: Upload the documentation + uses: actions/upload-artifact@v4 + with: + name: PNDependencyGraph.doccarchive.tar.gz + path: /tmp/PNDependencyGraph.doccarchive.tar.gz + deploy: + needs: documentation + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: macOS-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Setup pages + uses: actions/configure-pages@v2 + - name: Download documentation + uses: actions/download-artifact@v4 + with: + name: PNDependencyGraph.doccarchive.tar.gz + - name: Unpack the documentation + run: tar -xf PNDependencyGraph.doccarchive.tar.gz + - name: Prepare documentation for hosting + run: $(xcodebuild -find docc) process-archive + transform-for-static-hosting + ./PNDependencyGraph.doccarchive + --hosting-base-path DependencyGraph + --output-path docs + - name: Redirect to the actual documentation + run: cp -f Auxilary/index.html docs/index.html + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +... diff --git a/Auxilary/index.html b/Auxilary/index.html new file mode 100644 index 0000000..ecf17b6 --- /dev/null +++ b/Auxilary/index.html @@ -0,0 +1,14 @@ + + + + ArgumentParser Documentation + + + +' diff --git a/Package.swift b/Package.swift index 1426828..ae65f18 100644 --- a/Package.swift +++ b/Package.swift @@ -12,6 +12,10 @@ let package = Package( targets: ["PNDependencyGraph"] ) ], + dependencies: [ + // other dependencies + .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0") + ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. From 6f6ee253050bb635447f3f6630b791ee51ee5de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Stompo=CC=81r?= Date: Sat, 27 Dec 2025 22:22:12 +0100 Subject: [PATCH 2/2] Remove comment --- Package.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Package.swift b/Package.swift index ae65f18..52e349b 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,6 @@ let package = Package( ) ], dependencies: [ - // other dependencies .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0") ], targets: [