diff --git a/.github/workflows/Doc.yml b/.github/workflows/Doc.yml index 1016291c85..07dd3f6108 100644 --- a/.github/workflows/Doc.yml +++ b/.github/workflows/Doc.yml @@ -5,12 +5,17 @@ on: types: - published - edited + push: + branches: + - 'main' + paths: + - '.github/workflows/Doc.yml' permissions: contents: write concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: diff --git a/Makefile b/Makefile index a2b17d2e83..8f7ce885fe 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ PACKAGE_PATHS := Package.swift commit: git add "$(file)" git commit -m "Commit via running $make $(file)" >/dev/null \ - && echo "::notice:: make $(file)\n" \ + && echo "::notice:: git commit $(file)\n" \ || true; touch "$(file)"; @@ -36,6 +36,7 @@ Sources/%: Sources/%/Client.swift @$(MAKE) commit file="$@" # Update openapi specification if needed +.PHONY: Submodule Submodule: ifdef GITHUB_ACTIONS ## https://docs.github.com/en/actions/learn-github-actions/variables @touch "$(OPENAPI_PATH)" @@ -56,5 +57,4 @@ $(PACKAGE_PATHS): $(SOURCE_DIRS) @$(MAKE) commit file="$@" # Install -.PHONY: Submodule install: Submodule .spi.yml diff --git a/Scripts/PackageBuilder.swift b/Scripts/PackageBuilder.swift index 60c9d2d631..548d842fcf 100644 --- a/Scripts/PackageBuilder.swift +++ b/Scripts/PackageBuilder.swift @@ -130,6 +130,7 @@ struct PackageBuilder { // swift-tools-version: \#(version.rawValue) // The swift-tools-version declares the minimum version of Swift required to build this package. + import Foundation import PackageDescription /// Generated via `$swift PackageBuilder.swift` @@ -157,8 +158,14 @@ struct PackageBuilder { ) ] ) - - + + // swift-docc is not needed for package users + if ProcessInfo.processInfo.environment["ENABLE_DOCC_SUPPORT"] == "1" { + package.dependencies += [ + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"), + ] + } + """# } func write() throws {