Skip to content

Commit

Permalink
Fix error: Unknown subcommand or plugin name ‘generate-documentation’
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei18 committed Mar 22, 2024
1 parent 2dbe51b commit 5eaa3b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/Doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)";

Expand All @@ -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)"
Expand All @@ -56,5 +57,4 @@ $(PACKAGE_PATHS): $(SOURCE_DIRS)
@$(MAKE) commit file="$@"

# Install
.PHONY: Submodule
install: Submodule .spi.yml
11 changes: 9 additions & 2 deletions Scripts/PackageBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5eaa3b2

Please sign in to comment.