11---
2- applyTo : " .github/workflows/build-release.yml "
2+ applyTo : " .github/workflows/** "
33description : " CI/CD Pipeline configuration for PyInstaller binary packaging and release workflow"
44---
55
66# CI/CD Pipeline Instructions
77
8+ ## Workflow Architecture (Fork-safe)
9+ Three workflows split by trigger and secret requirements:
10+
11+ 1 . ** ` ci.yml ` ** — ` pull_request ` trigger (all PRs, including forks)
12+ - Unit tests + build. No secrets needed. Gives fast feedback.
13+ - Uploads binary artifacts for downstream integration testing.
14+ 2 . ** ` ci-integration.yml ` ** — ` workflow_run ` trigger (after CI completes, environment-gated)
15+ - Smoke tests, integration tests, release validation. Requires ` integration-tests ` environment approval.
16+ - Security: uses ` workflow_run ` (not ` pull_request_target ` ) — PR code is NEVER checked out.
17+ - Downloads binary artifacts from ci.yml, runs test scripts from default branch (main).
18+ - Reports results back to PR via commit status API.
19+ 3 . ** ` build-release.yml ` ** — ` push ` to main, tags, schedule, ` workflow_dispatch `
20+ - Full pipeline for post-merge / release. Secrets always available.
21+
822## PyInstaller Binary Packaging
923- ** CRITICAL** : Uses ` --onedir ` mode (NOT ` --onefile ` ) for faster CLI startup performance
1024- ** Binary Structure** : Creates ` dist/{binary_name}/apm ` (nested directory containing executable + dependencies)
@@ -22,9 +36,18 @@ description: "CI/CD Pipeline configuration for PyInstaller binary packaging and
22363 . ** Path Resolution** : Use symlinks and PATH manipulation for isolated binary testing
2337
2438## Release Flow Dependencies
25- - ** Sequential Jobs** : test → build → integration-tests → release-validation → create-release → publish-pypi → update-homebrew
39+ - ** PR workflow** : ci.yml (test → build) then ci-integration.yml via workflow_run (approve → smoke-test → integration-tests → release-validation → report-status)
40+ - ** Push/Release workflow** : test → build → integration-tests → release-validation → create-release → publish-pypi → update-homebrew
2641- ** Tag Triggers** : Only ` v*.*.* ` tags trigger full release pipeline
2742- ** Artifact Retention** : 30 days for debugging failed releases
43+ - ** Cross-workflow artifacts** : ci-integration.yml downloads artifacts from ci.yml using ` run-id ` and ` github-token `
44+
45+ ## Fork PR Security Model
46+ - Fork PRs get unit tests + build via ` ci.yml ` (no secrets, runs PR code safely)
47+ - ` ci-integration.yml ` triggers via ` workflow_run ` after CI completes — NEVER checks out PR code
48+ - Binary artifacts from ci.yml are tested using test scripts from the default branch (main)
49+ - Environment approval gate (` integration-tests ` ) ensures maintainer reviews PR before integration tests run
50+ - Commit status is reported back to the PR SHA so results appear on the PR
2851
2952## Key Environment Variables
3053- ` PYTHON_VERSION: '3.12' ` - Standardized across all jobs
0 commit comments