Skip to content

Commit d95801c

Browse files
authored
Merge branch 'main' into dependabot/cargo/rust/criterion-0.8.2
2 parents 153458b + cb3eca8 commit d95801c

52 files changed

Lines changed: 5056 additions & 158 deletions

Some content is hidden

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

.github/workflows/changelog.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
permissions:
1212
contents: write
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
with:
1616
ref: main
17+
fetch-depth: 0
1718
token: ${{ secrets.PAT }}
1819

1920
- name: Get release info and update CHANGELOG
@@ -25,8 +26,6 @@ jobs:
2526
TAG="${{ github.event.release.tag_name }}"
2627
DATE=$(gh release view "$TAG" --json publishedAt --jq '.publishedAt | split("T")[0]')
2728
BODY=$(gh release view "$TAG" --json body --jq '.body // ""')
28-
printf '%s\n' "$BODY" > release_body.md
29-
python3 scripts/validate_release_notes.py release_body.md
3029
3130
{
3231
echo "## [$TAG](https://github.com/${{ github.repository }}/releases/tag/$TAG) - $DATE"
@@ -52,7 +51,7 @@ jobs:
5251
awk '/^---$/ && !found {found=1; print > "header.md"; next} !found {print > "header.md"} found {print > "old_entries.md"}' CHANGELOG.md
5352
touch old_entries.md
5453
cat header.md new_entry.md old_entries.md > CHANGELOG.md
55-
rm -f header.md new_entry.md old_entries.md release_body.md
54+
rm -f header.md new_entry.md old_entries.md
5655
5756
- name: Commit and push
5857
run: |

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
contents: read
1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v5
21+
uses: actions/checkout@v6
2222

2323
- name: Set up uv
2424
uses: astral-sh/setup-uv@v7

.github/workflows/docs.yaml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
paths: ['docs/**', 'examples/**', 'zensical.toml', 'overrides/**', 'README.md', 'CONTRIBUTING.md', 'pyproject.toml', 'uv.lock', 'CHANGELOG.md']
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types: [published]
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: docs-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-deploy:
19+
runs-on: ubuntu-24.04
20+
permissions:
21+
contents: read
22+
pull-requests: write
23+
issues: write
24+
steps:
25+
- uses: actions/checkout@v6
26+
- name: Install the latest version of uv
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
python-version: "3.14"
30+
- name: Install dependencies
31+
run: uv sync --only-group docs
32+
- name: Copy CHANGELOG to docs
33+
run: |
34+
if [ -f CHANGELOG.md ]; then
35+
cp CHANGELOG.md docs/changelog.md
36+
else
37+
echo "# Changelog" > docs/changelog.md
38+
echo "" >> docs/changelog.md
39+
echo "Changelog will be available after the first release." >> docs/changelog.md
40+
fi
41+
- name: Update docs version
42+
run: uv run python scripts/update_docs_version.py
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
- name: build site
46+
run: uv run --only-group docs zensical build --clean
47+
48+
# PR Preview Deploy (skip forked PRs as secrets are not available)
49+
- name: Deploy Preview
50+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
51+
uses: cloudflare/wrangler-action@v3
52+
with:
53+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
54+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
55+
command: pages deploy site --project-name=tstring-structured-data --branch=pr-${{ github.event.pull_request.number }}
56+
57+
- name: Comment Preview URL on PR
58+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
59+
uses: actions/github-script@v8
60+
with:
61+
script: |
62+
const previewUrl = 'https://pr-${{ github.event.pull_request.number }}.tstring-structured-data.pages.dev';
63+
const body = `📚 **Docs Preview:** ${previewUrl}`;
64+
65+
// Check if comment already exists
66+
const comments = await github.rest.issues.listComments({
67+
issue_number: context.issue.number,
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
});
71+
72+
const existingComment = comments.data.find(c => c.body.includes('Docs Preview:'));
73+
74+
if (existingComment) {
75+
await github.rest.issues.updateComment({
76+
owner: context.repo.owner,
77+
repo: context.repo.repo,
78+
comment_id: existingComment.id,
79+
body: body
80+
});
81+
} else {
82+
await github.rest.issues.createComment({
83+
issue_number: context.issue.number,
84+
owner: context.repo.owner,
85+
repo: context.repo.repo,
86+
body: body
87+
});
88+
}
89+
90+
# Dev Deploy (on push to main)
91+
- name: Deploy Dev
92+
if: github.event_name == 'push'
93+
uses: cloudflare/wrangler-action@v3
94+
with:
95+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
96+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
97+
command: pages deploy site --project-name=tstring-structured-data --branch=dev
98+
99+
# Production Deploy (on release only)
100+
- name: Deploy Production
101+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
102+
uses: cloudflare/wrangler-action@v3
103+
with:
104+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
105+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
106+
command: pages deploy site --project-name=tstring-structured-data --branch=main

.github/workflows/json-tstring-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
working-directory: json-tstring
2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929

3030
- name: Set up uv
3131
uses: astral-sh/setup-uv@v7

.github/workflows/llms-txt.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Update llms.txt
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**/*.md'
8+
- 'zensical.toml'
9+
- 'scripts/build_llms_txt.py'
10+
pull_request:
11+
branches: [main]
12+
paths:
13+
- 'docs/**/*.md'
14+
- 'zensical.toml'
15+
- 'scripts/build_llms_txt.py'
16+
pull_request_target:
17+
types: [labeled]
18+
paths:
19+
- 'docs/**/*.md'
20+
- 'zensical.toml'
21+
- 'scripts/build_llms_txt.py'
22+
23+
permissions:
24+
contents: write
25+
26+
jobs:
27+
update-llms-txt:
28+
if: |
29+
github.event_name == 'push' ||
30+
!github.event.pull_request.head.repo.fork ||
31+
github.actor == 'koxudaxi' ||
32+
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-fix' &&
33+
github.event.sender.login == 'koxudaxi')
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v6
37+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
38+
with:
39+
fetch-depth: 0
40+
ref: ${{ github.event.pull_request.head.ref }}
41+
repository: ${{ github.event.pull_request.head.repo.full_name }}
42+
- uses: actions/checkout@v6
43+
if: github.event_name == 'push' || github.event_name == 'pull_request_target' || github.event.pull_request.head.repo.full_name == github.repository
44+
with:
45+
fetch-depth: 0
46+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
47+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
48+
token: ${{ secrets.PAT }}
49+
- name: Install the latest version of uv
50+
uses: astral-sh/setup-uv@v5
51+
with:
52+
python-version: "3.14"
53+
- name: Build llms.txt
54+
run: uv run python scripts/build_llms_txt.py
55+
- name: Commit and push if changed
56+
if: github.event_name == 'push' || github.event_name == 'pull_request_target' || github.event.pull_request.head.repo.full_name == github.repository
57+
run: |
58+
git config user.name "github-actions[bot]"
59+
git config user.email "github-actions[bot]@users.noreply.github.com"
60+
git add docs/llms.txt docs/llms-full.txt
61+
git diff --staged --quiet || git commit -m "docs: update llms.txt files
62+
63+
Generated by GitHub Actions"
64+
git push

0 commit comments

Comments
 (0)