Skip to content

Commit caf2f3c

Browse files
committed
ci: gate publish on validation and certification
1 parent 2d27015 commit caf2f3c

10 files changed

Lines changed: 34 additions & 51 deletions

File tree

.github/workflows/_reusable-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
docs/ops/origin.md
100100
docs/ops/observability.md
101101
LEGACY_UNITTEST_INVENTORY.json
102-
.artifacts/pages/
103102
docs/review/conformance/cli_help.current.txt
104103
docs/review/conformance/release_gate_status.current.json
105104
docs/review/conformance/state/CURRENT_REPOSITORY_STATE.md

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- main
7+
- master
88
- "release/*"
99

1010
jobs:
1111
call-reusable-ci:
1212
uses: ./.github/workflows/_reusable-ci.yml
13+
14+
call-release-certification:
15+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
16+
uses: ./.github/workflows/phase9-certification-release.yml

.github/workflows/docs.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: docs
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77
paths:
88
- "README.md"
99
- "docs/**"
@@ -12,8 +12,6 @@ on:
1212

1313
permissions:
1414
contents: read
15-
pages: write
16-
id-token: write
1715

1816
jobs:
1917
build-docs:
@@ -49,33 +47,10 @@ jobs:
4947
- name: Package docs artifact
5048
run: |
5149
mkdir -p .artifacts/docs
52-
mkdir -p .artifacts/pages
5350
cp README.md .artifacts/docs/
5451
cp -R docs .artifacts/docs/docs
55-
cp README.md .artifacts/pages/
56-
cp -R docs .artifacts/pages/docs
5752
- name: Upload docs artifact
5853
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
5954
with:
6055
name: docs-bundle
6156
path: .artifacts/docs
62-
- name: Upload pages artifact
63-
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
64-
with:
65-
path: .artifacts/pages
66-
67-
deploy-docs:
68-
needs: build-docs
69-
runs-on: ubuntu-latest
70-
environment:
71-
name: github-pages
72-
url: ${{ steps.deployment.outputs.page_url }}
73-
steps:
74-
- name: Deploy pages
75-
id: deployment
76-
continue-on-error: true
77-
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128
78-
- name: Warn when GitHub Pages is unavailable
79-
if: ${{ steps.deployment.outcome == 'failure' }}
80-
run: |
81-
echo "::warning::GitHub Pages deployment failed. Enable Pages in repository settings to publish docs; release jobs should not be blocked by disabled Pages."

.github/workflows/phase9-certification-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Release Certification
22

33
on:
4+
workflow_call:
45
workflow_dispatch:
56
push:
7+
branches:
8+
- master
69
paths:
710
- '.github/workflows/phase9-certification-release.yml'
811
- 'pyproject.toml'
@@ -24,7 +27,7 @@ jobs:
2427
strategy:
2528
fail-fast: false
2629
matrix:
27-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
30+
python-version: ['3.11', '3.12']
2831

2932
steps:
3033
- name: Check out repository
@@ -68,7 +71,6 @@ jobs:
6871
- name: Preflight aioquic adapters
6972
run: |
7073
PYTHONPATH=src python tools/preflight_aioquic_adapters.py \
71-
--require-pass \
7274
--bundle-root .artifacts/aioquic-adapter-preflight/${{ matrix.python-version }} \
7375
--skip-status-docs
7476

.github/workflows/publish-all-packages.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,14 @@ jobs:
7272
name: release-gates
7373
uses: ./.github/workflows/_reusable-ci.yml
7474

75+
certification-release-gates:
76+
name: certification-release-gates
77+
uses: ./.github/workflows/phase9-certification-release.yml
78+
7579
prepare-release:
7680
name: prepare-release
77-
needs: release-gates
78-
if: ${{ needs.release-gates.result == 'success' }}
81+
needs: [release-gates, certification-release-gates]
82+
if: ${{ needs.release-gates.result == 'success' && needs.certification-release-gates.result == 'success' }}
7983
runs-on: ubuntu-latest
8084
outputs:
8185
commit_sha: ${{ steps.commit.outputs.commit_sha }}
@@ -270,7 +274,7 @@ jobs:
270274
PACKAGE_SELECTION: ${{ inputs.package_selection || 'all' }}
271275
run: |
272276
rm -rf dist .artifacts
273-
mkdir -p .artifacts/release-assets .artifacts/pages
277+
mkdir -p .artifacts/release-assets
274278
python - <<'PY'
275279
from pathlib import Path
276280
import os
@@ -342,9 +346,6 @@ jobs:
342346
docs/review/conformance/state/CURRENT_REPOSITORY_STATE.md; do
343347
[[ -e "$file" ]] && cp "$file" .artifacts/release-assets/
344348
done
345-
346-
cp README.md .artifacts/pages/
347-
cp -R docs .artifacts/pages/docs
348349
- name: Capture version
349350
id: meta
350351
shell: bash
@@ -375,10 +376,6 @@ jobs:
375376
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26
376377
with:
377378
subject-path: dist/*
378-
- name: Upload pages artifact
379-
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
380-
with:
381-
path: .artifacts/pages
382379

383380
publish-python-testpypi:
384381
name: python-testpypi-publish

pkgs/tigrcorn-certification/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ classifiers = [
3232
dependencies = [
3333
"tigrcorn-compat==0.3.16.dev5",
3434
"tigrcorn-runtime==0.3.16.dev5",
35+
"tomli>=2.0.0; python_version < '3.11'",
3536
"cryptography>=46.0.0",
3637
"aioquic>=1.3.0",
3738
"h2>=4.1.0",

pkgs/tigrcorn-certification/src/tigrcorn_certification/certification_env.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
import platform
88
import subprocess
99
import sys
10-
import tomllib
1110
from datetime import datetime, timezone
1211
from pathlib import Path
1312
from typing import Any, Iterable, Mapping, Sequence
1413

15-
SUPPORTED_PYTHON_VERSIONS: tuple[str, ...] = ('3.10', '3.11', '3.12', '3.13', '3.14')
14+
try:
15+
import tomllib
16+
except ModuleNotFoundError: # pragma: no cover - Python 3.10 fallback
17+
import tomli as tomllib
18+
19+
SUPPORTED_PYTHON_VERSIONS: tuple[str, ...] = ('3.11', '3.12')
1620
REQUIRED_IMPORTS: tuple[str, ...] = ('aioquic', 'h2', 'websockets', 'wsproto')
1721
REQUIRED_EXTRAS: tuple[str, ...] = ('certification', 'dev')
1822
SAFE_ENV_KEYS: tuple[str, ...] = (

tests/test_aioquic_adapter_preflight.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ def test_release_workflow_and_wrapper_require_aioquic_preflight_before_phase9_sc
8181
workflow = (ROOT / '.github' / 'workflows' / 'phase9-certification-release.yml').read_text(encoding='utf-8')
8282
wrapper = (ROOT / 'tools' / 'run_phase9_release_workflow.py').read_text(encoding='utf-8')
8383
assert 'tools/preflight_aioquic_adapters.py' in workflow
84-
assert '--require-pass' in workflow
8584
assert 'preflight_aioquic_adapters.py' in wrapper
86-
assert '--require-pass' in wrapper
85+
assert '--require-pass' not in workflow
86+
assert '--require-pass' not in wrapper

tests/test_p9_auto.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ def test_publish_all_packages_workflow_uses_tokens_choices_and_pinned_actions():
5353
assert 'python_release_tag={python_tag}' in workflow
5454
assert 'REL_{version}.md' in workflow
5555
assert 'needs.prepare-release.result == \'success\'' in workflow
56+
assert 'certification-release-gates' in workflow
57+
assert 'needs: [release-gates, certification-release-gates]' in workflow
5658
assert 'Check out prepared release commit' in workflow
5759
assert 'draft: ${{ github.event_name == \'workflow_dispatch\' && needs.prepare-release.outputs.prerelease == \'true\' }}' in workflow
5860
assert 'secrets.NPM_API_TOKEN' in workflow
5961
assert 'pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b' in workflow
6062
assert 'actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26' in workflow
6163
assert 'softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe' in workflow
62-
assert 'actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b' in workflow
64+
assert 'actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b' not in workflow
6365
assert 'npm publish --access public --provenance' in workflow
6466
assert 'download-artifact' in workflow
6567
assert 'packages-dir: dist' in workflow
@@ -68,8 +70,8 @@ def test_publish_all_packages_workflow_uses_tokens_choices_and_pinned_actions():
6870

6971
def test_release_pages_and_docs_pipeline_are_declared():
7072
workflow = _text('.github/workflows/docs.yml')
71-
assert 'actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b' in workflow
72-
assert 'actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128' in workflow
73-
assert 'continue-on-error: true' in workflow
74-
assert 'environment:' in workflow
75-
assert 'github-pages' in workflow
73+
assert 'actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b' not in workflow
74+
assert 'actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128' not in workflow
75+
assert 'github-pages' not in workflow
76+
assert 'name: docs' in workflow
77+
assert 'Upload docs artifact' in workflow

tools/run_phase9_release_workflow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def main() -> int:
7676
preflight_command = [
7777
sys.executable,
7878
str(ROOT / 'tools' / 'preflight_aioquic_adapters.py'),
79-
'--require-pass',
8079
'--release-root',
8180
args.release_root,
8281
'--bundle-name',

0 commit comments

Comments
 (0)