diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cfb02a8..025b574 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -213,19 +213,12 @@ jobs: -rewriteAll \ -webVowl - # Default entry point (English) cp "./_site/${VERSION}/doc/index-en.html" "./_site/${VERSION}/doc/index.html" || true - # ── Note: serializations are served by Widoco automatically ───────────── - # Widoco copies the source ontology file and generates download buttons - # for JSON-LD, RDF/XML, N-Triples, and TTL in the HTML documentation. - # The files are placed at the root of the doc/ output as ontology.jsonld, - # ontology.rdf, ontology.ntx, ontology.ttl — no manual copy needed. - # ── Update /dev/ ────────────────────────────────────────────────────── - # /dev/ always mirrors the latest build from main (every push). - # Named releases (e.g. /2025-11-20/ or /1.0.0/) are preserved alongside. - # This gives a stable URL for development/preview access. + # Always mirrors the latest build. On a qc build (no version payload) + # this is the only thing published — no versioned directory, no index + # update — keeping release history clean. # ────────────────────────────────────────────────────────────────────── - name: Update /dev/ run: | @@ -233,12 +226,12 @@ jobs: rm -rf ./_site/dev cp -r "./_site/${VERSION}" ./_site/dev - # ── Build root index.html ───────────────────────────────────────────── - # Generates a simple version listing page as the site root. - # Reads existing version directories from the previously fetched - # gh-pages branch and adds the current version to the list. + # ── Build root index.html (release only) ───────────────────────────── + # Only regenerated when a real version is provided (release trigger). + # qc builds only update /dev/ and skip this step. # ────────────────────────────────────────────────────────────────────── - name: Build root index.html + if: needs.check.outputs.version != 'latest' run: | VERSION="${{ needs.check.outputs.version }}" @@ -323,6 +316,12 @@ jobs: # rm -rf / # git commit -am "Remove version " && git push # ────────────────────────────────────────────────────────────────────── + # On qc builds (version = "latest") remove the _site/latest/ build dir — + # /dev/ already has the content; we don't want a permanent /latest/ page. + - name: Drop build dir for dev deploys + if: needs.check.outputs.version == 'latest' + run: rm -rf ./_site/latest + - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v4 with: diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 833fda8..b5ef8df 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -57,17 +57,17 @@ on: # Bot commits from this workflow touch only release artifacts (*.owl, *.ttl, # *.json) which are NOT in the paths list below, so there is no infinite loop. push: - branches: ["main"] + branches: [main] paths: - - 'src/ontology/*-edit.owl' - - 'src/ontology/components/**' - - 'src/ontology/imports/**' - - 'src/ontology/Makefile' - - 'src/ontology/*-Makefile' + - src/ontology/*-edit.owl + - src/ontology/components/** + - src/ontology/imports/** + - src/ontology/Makefile + - src/ontology/*-Makefile # ── Pull request: fast PR checks (no path filter — runs on every PR) ──────── pull_request: - branches: ["main"] + branches: [main] # ── Manual trigger ────────────────────────────────────────────────────────── workflow_dispatch: @@ -317,20 +317,29 @@ jobs: # ────────────────────────────────────────────────────────────────────── - name: Build ontology (refresh imports + generate all release assets) env: - ROBOT_ENV: 'ROBOT_JAVA_ARGS=-Xmx6G' + ROBOT_ENV: ROBOT_JAVA_ARGS=-Xmx6G run: | cd src/ontology make refresh-imports all_assets # ── Commit release artifacts ─────────────────────────────────────────── + # git add each glob separately so a missing pattern (e.g. no *.json) does + # not abort the entire staging step. + - name: Stage release artifacts + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git add src/ontology/*.owl || true + git add src/ontology/*.ttl || true + git add src/ontology/*.json || true + git add src/ontology/imports/*.owl || true + - name: Commit ontology release assets - uses: EndBug/add-and-commit@v9 - with: - message: "Building the ontology from the edits" - cwd: "." - add: "src/ontology/*.owl src/ontology/*.json src/ontology/*.ttl src/ontology/imports/*.owl --force" - default_author: github_actions - push: true + run: | + git diff --cached --quiet && echo "Nothing to commit." && exit 0 + git commit -m "Building the ontology from the edits" + git push # ── Trigger documentation workflow ───────────────────────────────────── - name: Trigger Documentation Workflow diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d1b543..03542d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,9 +95,12 @@ jobs: - name: Stamp version into artifacts run: | VERSION="${{ steps.version.outputs.version }}" - ONTBASE="https://w3id.org/pmd/log" - for f in src/ontology/log-full.owl src/ontology/log-base.owl src/ontology/log-simple.owl src/ontology/log.owl; do - [ -f "$f" ] || continue + ODK_YAML=$(find src/ontology -maxdepth 1 -name "*-odk.yaml" | head -1) + ONT_ID=$(python3 -c "import yaml; d=yaml.safe_load(open('$ODK_YAML')); print(d['id'])") + URIBASE=$(python3 -c "import yaml; d=yaml.safe_load(open('$ODK_YAML')); print(d['uribase'])") + ONTBASE="${URIBASE}/${ONT_ID}" + for f in $(find src/ontology -maxdepth 1 -name "*.owl" \ + ! -name "*-edit.owl" ! -name "*-idranges.owl"); do robot annotate \ --input "$f" \ --version-iri "${ONTBASE}/${VERSION}" \ @@ -117,7 +120,7 @@ jobs: with: message: Release v${{ steps.version.outputs.version }} cwd: . - add: src/ontology/*.owl src/ontology/*.ttl --force + add: src/ontology/*.owl src/ontology/*.ttl default_author: github_actions push: true diff --git a/.gitignore b/.gitignore index 10e5221..7b45c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -32,16 +32,6 @@ src/ontology/mirror src/ontology/mirror/* src/ontology/reports/* !src/ontology/reports/release-diff.md -src/ontology/log.owl -src/ontology/log.obo -src/ontology/log.json -src/ontology/log.db -src/ontology/log-base.* -src/ontology/log-basic.* -src/ontology/log-full.* -src/ontology/log-simple.* -src/ontology/log-simple-non-classified.* - src/ontology/seed.txt src/ontology/dosdp-tools.log src/ontology/ed_definitions_merged.owl