-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (53 loc) · 1.73 KB
/
Documentation.yml
File metadata and controls
66 lines (53 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Generate and Deploy Documentation
on:
push:
branches:
- main
- develop
- feature/documentation
jobs:
build-and-deploy:
runs-on: macos-15
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Update Xcode Settings
run: |
set -euo pipefail
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES
- name: Load Latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install SourceDocs
run: brew install sourcedocs
- name: Build project
run: swift build
- name: Remove Unwanted Remark Lines
run: |
find . -type f -name "*.swift" -print0 | xargs -0 sed -i '' '/^[[:space:]]*\/\/\/ - Remark:/d'
- name: Generate Documentation
run: sourcedocs generate --all-modules
- name: Process Documentation
run: |
# Make the script executable
chmod +x ./fix_readme.sh
# Run the script
./fix_readme.sh
- name: Commit Documentation
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
if git diff --cached --quiet; then
echo "No documentation updates to commit; skipping commit step."
else
git commit -m "Update documentation"
fi
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
force: true