Skip to content

feat!: remove x-oold-reverse-default-properties from the vocabulary #214

feat!: remove x-oold-reverse-default-properties from the vocabulary

feat!: remove x-oold-reverse-default-properties from the vocabulary #214

Workflow file for this run

name: main
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
# Pin zensical (docs build) and the zensical fork of mike (versioning bridge)
# for reproducible builds/deploys.
env:
ZENSICAL_VERSION: "0.0.46"
MIKE_SPEC: "git+https://github.com/squidfunk/mike.git@2.2.0+zensical-0.1.0"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history + tags so render_spec.py can derive the spec version
- uses: astral-sh/setup-uv@v6
# Validation runs on oold-python. --meta . reads the meta-schemas and the rule
# catalogue from THIS checkout, so a rule added in this branch is enforced by the
# run that introduces it; a released version could not see it. Node is no longer
# installed here: scripts/validate.mjs is frozen as the reference oold-python is
# compared against, and is run by that comparison rather than by this workflow.
- run: make validate
# Re-render the spec and fail if the committed docs/spec/index.html is stale
# (drift guard), then lint its structure. Renderer deps are pinned inline
# via PEP 723, so `uv run` stays reproducible.
- name: Render the spec
run: uv run scripts/render_spec.py
- name: Check the generated spec is up to date
run: git diff --exit-code docs/spec/index.html
- name: Lint the spec
run: uv run scripts/check_spec.py
# The same drift guard for the rule catalogue, plus the baseline check. Both also run as
# pre-commit hooks, but a hook only protects a contributor who installed it, and what the
# baseline guards - a rule id quietly disappearing, or a rule's text changing meaning under
# the same id - is exactly what nobody catches by eye in a prose diff. Regenerating here and
# failing on any difference is what makes the guarantee hold for everyone.
- name: Extract the rule catalog
run: uv run scripts/extract_rules.py
- name: Check the rule baseline
run: uv run scripts/rules_baseline.py check
- name: Render the rule catalogue page
run: uv run scripts/render_rules_page.py
- name: Check the catalog, baseline and rule catalogue page are up to date
run: git diff --exit-code meta/oold-rules.json meta/rules-baseline.json docs/rules.md
# Declaring any markdown_extensions replaces Zensical's defaults rather than
# extending them, so an omission silently switches an extension off instead of
# failing the build. zensical.toml restates the defaults to keep the effective
# set visible; this checks that restatement against the pinned Zensical, so
# bumping ZENSICAL_VERSION cannot change the set unnoticed.
- name: Check the restated Markdown extensions match Zensical's defaults
run: uv run --with zensical==${{ env.ZENSICAL_VERSION }} scripts/check_markdown_extensions.py
# Publish the versioned docs + schemas to the `gh-pages` branch with mike (the
# zensical fork). GitHub Pages must serve from `gh-pages`
# (Settings > Pages > Source: Deploy from a branch > gh-pages).
# meta/ + examples/ are staged into docs/ so every version also serves them at
# /<ver>/meta and /<ver>/schemas. main -> the `dev` version; a `vX.Y.Z` tag ->
# version `X.Y` with the `latest` alias (and root redirect via set-default).
deploy:
needs: validate
runs-on: ubuntu-latest
# Serialize ALL deploys on one group so concurrent runs never race to push
# gh-pages. A per-ref group let a main push (-> dev) and a tag push (-> release)
# deploy simultaneously, and one lost the fast-forward (seen releasing v0.5.0).
# Queue rather than cancel so no deploy is dropped.
concurrency:
group: pages-deploy
cancel-in-progress: false
permissions:
contents: write # mike pushes to gh-pages
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v6
- name: Stage schemas into the site
run: make stage-schemas
# mike commits the built site to gh-pages; GitHub runners have no default
# git identity, so `git commit` would fail without this.
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Build only (pull request)
if: github.event_name != 'push'
# --with pyyaml: the shared macros render JSON / "View as YAML" example tabs.
run: uvx --with pyyaml==6.0.2 zensical@${{ env.ZENSICAL_VERSION }} build --clean
- name: Publish dev (push to main)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
# Stamp the served schema copies with this version id so they self-identify
# (the source keeps the oo-ld.org/latest/ placeholder; staged copies are gitignored).
sed -i 's#oo-ld\.org/latest/#oo-ld.org/dev/#g' docs/meta/*.json docs/schemas/*.json
uvx --with pyyaml==6.0.2 --from "$MIKE_SPEC" mike deploy --push dev
- name: Publish release (tag vX.Y.Z)
if: startsWith(github.ref, 'refs/tags/v')
run: |
ver="${GITHUB_REF_NAME#v}" # full semver (e.g. 0.4.0) -> served at /0.4.0/, matching OO-LD package-versioning
# Stamp the concrete version into the served schemas so /X.Y.Z/ self-identifies
# (spec-compliant + reproducible); the source keeps the oo-ld.org/latest/ placeholder.
sed -i "s#oo-ld\.org/latest/#oo-ld.org/$ver/#g" docs/meta/*.json docs/schemas/*.json
# --alias-type=copy so /latest/ is a real directory (its schema JSON is
# fetchable; a redirect alias would 404 for machine schema references).
MIKE="uvx --with pyyaml==6.0.2 --from $MIKE_SPEC mike"
# TEMPORARY, until v1.0.0 ships: every release, pre-release included, repoints
# `latest` and the site default. During the v1.0 review window the candidate is the
# document reviewers should be reading, and a /latest/ still serving 0.9.0 sends
# them to superseded prose. The concrete /X.Y.Z/ of every release stays published,
# so pinning remains possible.
#
# REVERT WHEN v1.0.0 IS TAGGED: restore the `case "$ver" in *-*) ... esac` guard so
# that `latest` tracks the most recent STABLE release again and never serves a
# release candidate. After v1.0 the trade-off flips - a stable spec exists, and
# /latest/ pointing at a candidate would then be the misleading answer.
$MIKE deploy --push --alias-type=copy --update-aliases "$ver" latest
$MIKE set-default --push latest