Skip to content

Commit 14957fa

Browse files
committed
Add documentation releated build and checks to GitHub workflows
There's nothing in the pull request verification that checks if the command-line references are up-to-date. Add a job to the pull request update workflow that verifies this. There's nothing in the release build workflow that generates the documentation and uploads the documentation artifacts so that they can be published. Add a step to the build release job that generates the documentation so that it can be published to swift.org.
1 parent 5d8ac14 commit 14957fa

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/build_release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ jobs:
2323
steps:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
26-
- name: Build Artifact
26+
- name: Build Release Artifact
2727
run: swift run build-swiftly-release ${{ inputs.skip }} ${{ inputs.version }}
28-
- name: Upload Artifact
28+
- name: Upload Release Artifact
2929
uses: actions/upload-artifact@v4
3030
with:
3131
path: .build/release/swiftly-*.tar.gz
3232
if-no-files-found: error
33+
- name: Build Documentation Artifacts
34+
run: swift package --allow-writing-to-directory .build/docs generate-documentation --target SwiftlyDocs --output-path .build/docs
35+
- name: Upload Documentation Artifacts
36+
uses: actions/upload-artifact@v4
37+
with:
38+
path: .build/docs/**
39+
if-no-files-found: error

.github/workflows/pull_request.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,24 @@ jobs:
5757
linux_pre_build_command: ./scripts/prep-gh-action.sh
5858
linux_build_command: swift run swiftformat --lint --dryrun .
5959
enable_windows_checks: false
60+
61+
docscheck:
62+
name: Documentation Check
63+
runs-on: ubuntu-latest
64+
container:
65+
image: "swift:6.0-noble"
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
- name: Prepare the action
70+
run: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh
71+
- name: Generate Swiftly CLI Reference and Check for Differences
72+
run: swift package plugin --allow-writing-to-package-directory generate-docs-reference && git diff-index --quiet HEAD -- || (echo "The documentation hasn't been updated with the latest swiftly command-line reference. Please run 'swift package plugin generate-docs-reference' and commit/push the changes."; exit 1)
73+
- name: Generate Documentation Set
74+
run: swift package --allow-writing-to-directory .build/docs generate-documentation --target SwiftlyDocs --output-path .build/docs
75+
- name: Upload Documentation Artifacts
76+
uses: actions/upload-artifact@v4
77+
with:
78+
path: .build/docs/**
79+
if-no-files-found: error
80+
retention-days: 1

0 commit comments

Comments
 (0)