From 5602593089e3a55b2e4a822c087f36c2b292d6b4 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 1 Apr 2024 11:16:16 +0200 Subject: [PATCH] Check license generation for every PR to avoid license-less crate additions (#10033) Also fix `anthropic` crate and make it AGPL-licensed, as it's used in the AGPL-licensed collab part only. Release Notes: - N/A --- .github/workflows/ci.yml | 3 +++ crates/anthropic/Cargo.toml | 4 ++-- crates/anthropic/LICENSE-AGPL | 1 + script/generate-licenses | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 120000 crates/anthropic/LICENSE-AGPL diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6a0948f9c..f9266c5f11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,9 @@ jobs: - name: Check unused dependencies uses: bnjbvr/cargo-machete@main + - name: Check license generation + run: script/generate-licenses /tmp/zed_licenses_output + - name: Ensure fresh merge shell: bash -euxo pipefail {0} run: | diff --git a/crates/anthropic/Cargo.toml b/crates/anthropic/Cargo.toml index ba0284185e..7d81209a9b 100644 --- a/crates/anthropic/Cargo.toml +++ b/crates/anthropic/Cargo.toml @@ -2,8 +2,8 @@ name = "anthropic" version = "0.1.0" edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +publish = false +license = "AGPL-3.0-or-later" [lib] path = "src/anthropic.rs" diff --git a/crates/anthropic/LICENSE-AGPL b/crates/anthropic/LICENSE-AGPL new file mode 120000 index 0000000000..5f5cf25dc4 --- /dev/null +++ b/crates/anthropic/LICENSE-AGPL @@ -0,0 +1 @@ +../../LICENSE-AGPL \ No newline at end of file diff --git a/script/generate-licenses b/script/generate-licenses index ccecec7b85..79dd884514 100755 --- a/script/generate-licenses +++ b/script/generate-licenses @@ -2,7 +2,7 @@ set -euo pipefail -OUTPUT_FILE=$(pwd)/assets/licenses.md +OUTPUT_FILE="${1:-$(pwd)/assets/licenses.md}" > $OUTPUT_FILE