11---
2- name : release
2+ name : Release
3+ run-name : Release ${{ github.event.release.tag_name }}
34
45on :
5- schedule :
6- - cron : ' 0 4 * * *'
7- push :
8- branches :
9- - ' **'
106 release :
117 types :
128 - published
@@ -22,31 +18,15 @@ concurrency:
2218
2319jobs :
2420 test :
25- if : github.event_name != 'schedule'
21+ name : Test Release
2622 runs-on : [self-hosted, macOS]
2723 steps :
28- - uses : actions/checkout@v6
24+ - name : Checkout Repository
25+ uses : actions/checkout@v6
2926 with :
3027 clean : true
31- - name : Clear SwiftPM caches
32- run : |
33- rm -rf ~/.swiftpm
34- rm -rf ~/Library/Caches/org.swift.swiftpm
35- rm -rf ~/Library/org.swift.swiftpm
36- rm -rf .swiftpm
37- rm -rf .build
38-
39- - name : Run Tests
40- run : swift test -v
4128
42- daily_test :
43- if : github.event_name == 'schedule'
44- runs-on : [self-hosted, macOS]
45- steps :
46- - uses : actions/checkout@v6
47- with :
48- clean : true
49- - name : Clear SwiftPM caches
29+ - name : Clear SwiftPM Caches
5030 run : |
5131 rm -rf ~/.swiftpm
5232 rm -rf ~/Library/Caches/org.swift.swiftpm
@@ -57,14 +37,16 @@ jobs:
5737 - name : Run Tests
5838 run : swift test -v
5939
60- docs :
61- if : github.ref == 'refs/heads/main'
40+ build_docs :
41+ name : Build DocC
6242 runs-on : [self-hosted, macOS]
6343 needs : test
6444 steps :
65- - uses : actions/checkout@v6
45+ - name : Checkout Repository
46+ uses : actions/checkout@v6
6647 with :
6748 clean : true
49+
6850 - name : Generate DocC
6951 run : |
7052 set -euo pipefail
@@ -74,31 +56,32 @@ jobs:
7456 -destination "generic/platform=iOS" \
7557 -derivedDataPath "$DERIVED_DATA"
7658
77- DOCCARCHIVE =$(find "$DERIVED_DATA" -path "*Build/Products/*/Extensions.doccarchive" -print -quit)
78- if [ -z "${DOCCARCHIVE :-}" ]; then
59+ DOCC_ARCHIVE =$(find "$DERIVED_DATA" -path "*Build/Products/*/Extensions.doccarchive" -print -quit)
60+ if [ -z "${DOCC_ARCHIVE :-}" ]; then
7961 echo "DocC archive not found in $DERIVED_DATA"
8062 exit 1
8163 fi
8264
8365 xcrun docc process-archive transform-for-static-hosting \
84- "$DOCCARCHIVE " \
66+ "$DOCC_ARCHIVE " \
8567 --output-path ./public \
8668 --hosting-base-path extensions
8769
88- cat > ./public/index.html <<'EOF '
70+ cat > ./public/index.html <<'INDEX '
8971 <!doctype html>
9072 <meta http-equiv="refresh" content="0; url=/extensions/documentation/extensions/" />
9173 <title>Extensions Documentation</title>
92- EOF
93- - name : Upload Pages artifact
74+ INDEX
75+
76+ - name : Upload Pages Artifact
9477 uses : actions/upload-pages-artifact@v4
9578 with :
9679 path : ./public
9780 name : github-pages
9881
99- deploy :
100- if : github.ref == 'refs/heads/main'
101- needs : docs
82+ deploy_docs :
83+ name : Deploy Docs
84+ needs : build_docs
10285 runs-on : ubuntu-latest
10386 environment :
10487 name : github-pages
@@ -109,16 +92,14 @@ jobs:
10992 uses : actions/deploy-pages@v4
11093
11194 notify_package_collection :
112- # Only notify when an actual GitHub Release is published
113- if : github.event_name == 'release' && github.event.action == 'published'
95+ name : Notify Package Collection
11496 runs-on : ubuntu-latest
115- needs : test
116-
97+ needs : deploy_docs
11798 steps :
118- - name : Trigger swift-package-collection rebuild
99+ - name : Trigger Swift Package Collection Rebuild
119100 env :
120101 COLLECTION_REPO : thatfactory/swift-package-collection
121- WORKFLOW_FILE : release .yml
102+ WORKFLOW_FILE : publish .yml
122103 REF : main
123104 GH_TOKEN : ${{ secrets.COLLECTION_TRIGGER_TOKEN }}
124105 SOURCE_REPO : ${{ github.repository }}
0 commit comments