diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index f189fb209..b2091217b 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -62,4 +62,25 @@ jobs: if: ${{ startsWith(matrix.platform.runner, 'windows') }} shell: cmd # Use `cmd` to run test for Windows, as PowerShell doesn't detect exit code by `os._exit(0)` correctly. run: | - ${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests \ No newline at end of file + ${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests + + validate-3p-notices: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Install cargo-about + run: cargo install --locked cargo-about + - name: Validate third-party notices (dry-run) + shell: bash + run: | + set +e + cargo about generate about.hbs > /dev/null + status=$? + if [ $status -ne 0 ]; then + echo "::error::Third-party notices validation failed. Please update /about.toml and rerun." + exit $status + fi \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b47fe723..dac805f77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,10 +94,32 @@ jobs: name: wheels-sdist path: dist + generate-3p-notices: + runs-on: ubuntu-latest + needs: [create-versioned-toml] + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: Cargo.toml + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Install cargo-about + run: cargo install --locked cargo-about + - name: Generate THIRD_PARTY_NOTICES.html + run: cargo about generate -o THIRD_PARTY_NOTICES.html about.hbs + - name: Upload THIRD_PARTY_NOTICES.html artifact + uses: actions/upload-artifact@v4 + with: + name: THIRD_PARTY_NOTICES.html + path: THIRD_PARTY_NOTICES.html + release: name: Release runs-on: ubuntu-latest - needs: [create-versioned-toml, build, test-abi3, sdist] + needs: [create-versioned-toml, build, test-abi3, sdist, generate-3p-notices] permissions: # Use to sign the release artifacts id-token: write @@ -111,6 +133,9 @@ jobs: - uses: actions/download-artifact@v4 with: name: Cargo.toml + - uses: actions/download-artifact@v4 + with: + name: THIRD_PARTY_NOTICES.html - uses: actions/download-artifact@v4 with: pattern: wheels-* diff --git a/Cargo.toml b/Cargo.toml index d160a16b2..650feb5eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ name = "cocoindex" version = "999.0.0" edition = "2024" rust-version = "1.88" +license = "Apache-2.0" [profile.release] codegen-units = 1 diff --git a/about.hbs b/about.hbs new file mode 100644 index 000000000..b24f8e0e5 --- /dev/null +++ b/about.hbs @@ -0,0 +1,70 @@ + + + + + + + +
+
+

Third Party Licenses

+

This page lists the licenses of the projects used in cargo-about.

+
+ +

Overview of licenses:

+ + +

All license text:

+ +
+ + + diff --git a/about.toml b/about.toml new file mode 100644 index 000000000..1f589d28f --- /dev/null +++ b/about.toml @@ -0,0 +1,12 @@ +accepted = [ + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "BSD-2-Clause", + "BSD-3-Clause", + "CDLA-Permissive-2.0", + "ISC", + "MIT", + "OpenSSL", + "Unicode-3.0", + "Zlib", +] diff --git a/pyproject.toml b/pyproject.toml index 5d9b6c115..a6eba4413 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ dependencies = [ "numpy>=1.23.2", ] license = "Apache-2.0" +license-files = ["THIRD_PARTY_NOTICES.html"] urls = { Homepage = "https://cocoindex.io/" } classifiers = [ "Development Status :: 3 - Alpha",