-
Notifications
You must be signed in to change notification settings - Fork 502
Add CI validation for OSS assets (fonts and licenses) #8828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7128097
feat: add CI validation for proprietary fonts and dependency licenses
snomiao df47114
fix: prevent proprietary ABCROM fonts from bundling in OSS builds
snomiao 5eafdf0
fix: add missing licenses to OSS validation allowlist
snomiao 517a358
fix: correct license allowlist format to remove leading spaces
snomiao 5c94217
fix: use Vite plugin to exclude proprietary fonts from OSS builds
snomiao 6cff947
fix: address CodeRabbit review comments
snomiao 62fe65a
refactor: use @onebeyond/license-checker instead of deprecated licens…
snomiao 6ae2036
refactor: switch to license-checker-rseidelsohn for better monorepo s…
snomiao c244f9f
refactor: use dynamic import for cloud onboarding routes
christian-byrne c8a2463
fix: remove redundant case-insensitive find patterns
christian-byrne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| name: 'CI: OSS Assets Validation' | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches-ignore: [wip/*, draft/*, temp/*] | ||
| push: | ||
| branches: [main, dev*] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate-fonts: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@9fd676a19091d4595eefd76e4bd31c97133911f1 # v4.2.0 | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | ||
| with: | ||
| node-version: 'lts/*' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build project | ||
| run: pnpm build | ||
| env: | ||
| DISTRIBUTION: localhost | ||
|
|
||
| - name: Check for proprietary fonts in dist | ||
| run: | | ||
| set -euo pipefail | ||
| echo '🔍 Checking dist for proprietary ABCROM fonts...' | ||
| if [ ! -d "dist" ] || [ -z "$(ls -A dist)" ]; then | ||
| echo '❌ ERROR: dist/ directory missing or empty!' | ||
| exit 1 | ||
| fi | ||
| # Check for ABCROM font files | ||
| if find dist/ -type f -iname '*abcrom*' \ | ||
| \( -name '*.woff' -o -name '*.woff2' -o -name '*.ttf' -o -name '*.otf' \) \ | ||
| -print -quit | grep -q .; then | ||
| echo '' | ||
| echo '❌ ERROR: Found proprietary ABCROM font files in dist!' | ||
| echo '' | ||
| find dist/ -type f -iname '*abcrom*' \ | ||
| \( -name '*.woff' -o -name '*.woff2' -o -name '*.ttf' -o -name '*.otf' \) | ||
| echo '' | ||
| echo 'ABCROM fonts are proprietary and should not ship to OSS builds.' | ||
| echo '' | ||
| echo 'To fix this:' | ||
| echo '1. Use conditional font loading based on isCloud' | ||
| echo '2. Ensure fonts are dynamically imported, not bundled' | ||
| echo '3. Check vite config for font handling' | ||
| exit 1 | ||
| fi | ||
| echo '✅ No proprietary fonts found in dist' | ||
| validate-licenses: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@9fd676a19091d4595eefd76e4bd31c97133911f1 # v4.2.0 | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | ||
| with: | ||
| node-version: 'lts/*' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Validate production dependency licenses | ||
| run: | | ||
| set -euo pipefail | ||
| echo '🔍 Checking production dependency licenses...' | ||
| # Use license-checker-rseidelsohn (actively maintained fork, handles monorepos) | ||
| # Exclude internal @comfyorg packages from license check | ||
| # Run in if condition to capture exit code | ||
| if npx license-checker-rseidelsohn@4 \ | ||
| --production \ | ||
| --summary \ | ||
| --excludePackages '@comfyorg/comfyui-frontend;@comfyorg/design-system;@comfyorg/registry-types;@comfyorg/shared-frontend-utils;@comfyorg/tailwind-utils;@comfyorg/comfyui-electron-types' \ | ||
| --onlyAllow 'MIT;MIT*;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;0BSD;BlueOak-1.0.0;Python-2.0;CC0-1.0;Unlicense;(MIT OR Apache-2.0);(MIT OR GPL-3.0);(Apache-2.0 OR MIT);(MPL-2.0 OR Apache-2.0);CC-BY-4.0;CC-BY-3.0;GPL-3.0-only'; then | ||
| echo '' | ||
| echo '✅ All production dependency licenses are approved!' | ||
| else | ||
| echo '' | ||
| echo '❌ ERROR: Found dependencies with non-approved licenses!' | ||
| echo '' | ||
| echo 'To fix this:' | ||
| echo '1. Check the license of the problematic package' | ||
| echo '2. Find an alternative package with an approved license' | ||
| echo '3. If the license is safe and OSI-approved, add it to the --onlyAllow list' | ||
| echo '' | ||
| echo 'For more info on OSI-approved licenses:' | ||
| echo 'https://opensource.org/licenses' | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,7 @@ browser_tests/local/ | |
| dist.zip | ||
|
|
||
| /temp/ | ||
| /tmp/ | ||
|
|
||
| # Generated JSON Schemas | ||
| /schemas/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.