Skip to content

docs(protocol): v1.15.0 — parallel ownership contract, reproducible e… #23

docs(protocol): v1.15.0 — parallel ownership contract, reproducible e…

docs(protocol): v1.15.0 — parallel ownership contract, reproducible e… #23

Workflow file for this run

name: docs
on:
push:
branches: [main]
tags: ['v*']
pull_request:
release:
types: [published]
permissions:
contents: read
jobs:
contract:
name: protocol contract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Validate protocol and documentation contracts
run: python3 -m unittest discover -s tests -p 'test_*.py' -v
links:
name: link check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Version-pinned raw URLs are excluded so docs can reference a tag
# in the same atomic push that introduces it; shields/star-history
# are dynamic badge services that rate-limit checkers; addyosmani.com
# drops connections from CI runner IPs (verified alive manually).
args: >-
--no-progress
--exclude 'img\.shields\.io|star-history\.com|raw\.githubusercontent\.com/yeasy/agentgo/v[0-9]|addyosmani\.com'
README.md README.zh-CN.md AGENTS.md AGENTS.zh-CN.md CONTRIBUTING.md SECURITY.md
fail: true
release-integrity:
name: release integrity
# Runs pre-publish on the v* tag push, so a mismatched tag/version or a
# public-download mismatch is caught before the immutable release is
# created; also runs post-publish on the release event as a backstop.
if: github.event_name == 'release' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event.release.tag_name || github.ref_name }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ env.RELEASE_TAG }}
persist-credentials: false
- name: Match release tag to the validated protocol
shell: bash
run: |
python3 scripts/validate_docs.py
template_tag="v$(sed -nE '1s/^<!-- AGENTS\.md v([^ ]+) \|.*/\1/p' AGENTS.md)"
if [[ "$RELEASE_TAG" != "$template_tag" ]]; then
echo "Release tag $RELEASE_TAG does not match template tag $template_tag" >&2
exit 1
fi
- name: Verify public stable downloads
shell: bash
run: |
download_dir="$(mktemp -d)"
curl --proto '=https' --tlsv1.2 --fail --silent --show-error --location \
--retry 5 --retry-all-errors --retry-delay 2 \
"https://raw.githubusercontent.com/yeasy/agentgo/${RELEASE_TAG}/AGENTS.md" \
--output "$download_dir/AGENTS.md"
curl --proto '=https' --tlsv1.2 --fail --silent --show-error --location \
--retry 5 --retry-all-errors --retry-delay 2 \
"https://raw.githubusercontent.com/yeasy/agentgo/${RELEASE_TAG}/AGENTS.zh-CN.md" \
--output "$download_dir/AGENTS.zh-CN.md"
cmp AGENTS.md "$download_dir/AGENTS.md"
cmp AGENTS.zh-CN.md "$download_dir/AGENTS.zh-CN.md"