diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 228c49e..42e2fff 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -6,6 +6,10 @@ on: schedule: - cron: '25 0 * * 0' +concurrency: + group: "codeql" + cancel-in-progress: false + jobs: analyze: name: Analyze diff --git a/.github/workflows/deploy_docc.yml b/.github/workflows/deploy_docc.yml new file mode 100644 index 0000000..db7d46c --- /dev/null +++ b/.github/workflows/deploy_docc.yml @@ -0,0 +1,45 @@ +name: Deploy DocC + +on: + push: + branches: ["main"] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "docc" + cancel-in-progress: false + +jobs: + build: + runs-on: macos-14 + env: + DEVELOPER_DIR: "/Applications/Xcode_16.0.app/Contents/Developer" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build DocC + run: | + make build_docc + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs + deploy: + runs-on: macos-14 + env: + DEVELOPER_DIR: "/Applications/Xcode_16.0.app/Contents/Developer" + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/Makefile b/Makefile index fe4f438..11662d9 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,22 @@ .PHONY: format format: - xcrun --sdk macosx swift-format swift-format -p -r -i . + xcrun --sdk macosx swift-format swift-format -p -r -i . + +.PHONY: build_docc +build_docc: + swift package \ + --allow-writing-to-directory ./docs \ + generate-documentation \ + --output-path ./docs \ + --disable-indexing \ + --symbol-graph-minimum-access-level internal \ + --include-extended-types \ + --enable-experimental-combined-documentation \ + --target IAPClient \ + --target IAPCore \ + --target IAPInterface \ + --target IAPModel \ + --target IAPView \ + --transform-for-static-hosting \ + --hosting-base-path InAppPurchaseViewer + diff --git a/Package.swift b/Package.swift index 2276965..7ccf36d 100644 --- a/Package.swift +++ b/Package.swift @@ -21,6 +21,7 @@ let package = Package( .package(url: "https://github.com/sparkle-project/Sparkle", exact: "2.6.4"), .package(url: "https://github.com/pointfreeco/swift-dependencies", exact: "1.4.0"), .package(url: "https://github.com/apple/swift-http-types", exact: "1.3.0"), + .package(url: "https://github.com/swiftlang/swift-docc-plugin", exact: "1.4.3"), ], targets: [ .target(