Skip to content

Commit 4c5911a

Browse files
authored
Add documentation related build and checks to GitHub workflows (#186)
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. Overcome git dubious repo error. Give the uploaded artifacts unique names to avoid collisions.
1 parent c5518b6 commit 4c5911a

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/workflows/build_release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,19 @@ 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:
31+
name: swiftly-release-x86_64
3132
path: .build/release/swiftly-*.tar.gz
3233
if-no-files-found: error
34+
- name: Build Documentation Artifacts
35+
run: swift package --allow-writing-to-directory .build/docs generate-documentation --target SwiftlyDocs --output-path .build/docs
36+
- name: Upload Documentation Artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: swiftly-docs
40+
path: .build/docs/**
41+
if-no-files-found: error

.github/workflows/pull_request.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- name: Upload Artifact
4444
uses: actions/upload-artifact@v4
4545
with:
46+
name: swiftly-release-x86_64
4647
path: .build/release/swiftly-*.tar.gz
4748
if-no-files-found: error
4849
retention-days: 1
@@ -57,3 +58,25 @@ jobs:
5758
linux_pre_build_command: ./scripts/prep-gh-action.sh
5859
linux_build_command: swift run swiftformat --lint --dryrun . || (echo "Please run 'swift run swiftformat .' to format the source code."; exit 1)
5960
enable_windows_checks: false
61+
62+
docscheck:
63+
name: Documentation Check
64+
runs-on: ubuntu-latest
65+
container:
66+
image: "swift:6.0-noble"
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v4
70+
- name: Prepare the action
71+
run: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh
72+
- name: Generate Swiftly CLI Reference and Check for Differences
73+
run: swift package plugin --allow-writing-to-package-directory generate-docs-reference && git config --global --add safe.directory $(pwd) && git diff --exit-code Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md || (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)
74+
- name: Generate Documentation Set
75+
run: swift package --allow-writing-to-directory .build/docs generate-documentation --target SwiftlyDocs --output-path .build/docs
76+
- name: Upload Documentation Artifacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: swiftly-docs
80+
path: .build/docs/**
81+
if-no-files-found: error
82+
retention-days: 1

0 commit comments

Comments
 (0)