Skip to content

Commit df2b34a

Browse files
authored
Merge pull request #1427 from SwiftGGTeam/Swift-6.1
Swift 6.1
2 parents 76e5ec7 + f84966c commit df2b34a

File tree

267 files changed

+8132
-65368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+8132
-65368
lines changed

.gitbook.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/test-publish

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# 在推送到 Swift-6.1 分支时触发
5+
push:
6+
branches:
7+
- Swift-6.1
8+
9+
# 允许手动触发
10+
workflow_dispatch:
11+
12+
# 设置 GITHUB_TOKEN 的权限以允许部署到 GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# 只允许一个并发部署,跳过正在进行的运行和最新排队的运行之间的运行
19+
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# 构建作业
26+
build:
27+
runs-on: macos-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v4
34+
35+
- name: Select Xcode
36+
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
37+
38+
- name: Build with DocC
39+
run: |
40+
# 使用 xcrun docc 构建文档
41+
xcrun docc convert TSPL.docc \
42+
--fallback-display-name "Swift 编程语言" \
43+
--fallback-bundle-identifier "org.swift.tspl" \
44+
--fallback-bundle-version 6.1 \
45+
--additional-symbol-graph-dir . \
46+
--output-path ./_site
47+
48+
- name: Add custom header and footer
49+
run: |
50+
# 将自定义的 header 和 footer 应用到生成的页面
51+
if [ -f "TSPL.docc/header-publish.html" ] && [ -f "TSPL.docc/footer.html" ]; then
52+
find ./_site -name "*.html" -type f -exec sed -i '' '/<\/head>/e cat TSPL.docc/header-publish.html' {} \;
53+
find ./_site -name "*.html" -type f -exec sed -i '' '/<\/body>/e cat TSPL.docc/footer.html' {} \;
54+
fi
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@v3
58+
59+
# 部署作业
60+
deploy:
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}
64+
runs-on: ubuntu-latest
65+
needs: build
66+
steps:
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44
/.build
55
/Package.resolved
66
/TSPL.docc/header.html
7+
/TSPL.docc/ReferenceManual/SummaryOfTheGrammar.md
78
/swift-book
8-
node_modules
9-
package-lock.json
10-
docs

CONTRIBUTING.md

Lines changed: 0 additions & 103 deletions
This file was deleted.

GITHUB_PAGES_SETUP.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)