Skip to content

Commit bd8f4de

Browse files
[rust] Verify the release metadata in CI (apache#4169)
1 parent 404c17c commit bd8f4de

12 files changed

Lines changed: 1571 additions & 379 deletions

File tree

.github/workflows/gateway-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
- name: Install cargo-deny
135135
uses: taiki-e/install-action@v2
136136
with:
137-
tool: cargo-deny@0.14.22
137+
tool: cargo-deny@0.20.2
138138

139139
- name: Check dependency licenses (Apache-compatible)
140140
run: cargo deny --locked check licenses

.github/workflows/rust-license-and-format.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ on:
2626
- 'fluss-rust/bindings/**'
2727
- 'fluss-rust/Cargo.toml'
2828
- 'fluss-rust/Cargo.lock'
29+
- 'fluss-rust/DEPENDENCIES.rust.tsv'
30+
- 'fluss-rust/LICENSE'
31+
- 'fluss-rust/NOTICE'
32+
- 'fluss-rust/scripts/**'
2933
- 'fluss-rust/deny.toml'
3034
- 'fluss-rust/.licenserc.yaml'
3135
- 'fluss-rust/rustfmt.toml'
@@ -40,6 +44,10 @@ on:
4044
- 'fluss-rust/bindings/**'
4145
- 'fluss-rust/Cargo.toml'
4246
- 'fluss-rust/Cargo.lock'
47+
- 'fluss-rust/DEPENDENCIES.rust.tsv'
48+
- 'fluss-rust/LICENSE'
49+
- 'fluss-rust/NOTICE'
50+
- 'fluss-rust/scripts/**'
4351
- 'fluss-rust/deny.toml'
4452
- 'fluss-rust/.licenserc.yaml'
4553
- 'fluss-rust/rustfmt.toml'
@@ -70,11 +78,29 @@ jobs:
7078
- name: Install cargo-deny
7179
uses: taiki-e/install-action@v2
7280
with:
73-
tool: cargo-deny@0.14.22
81+
tool: cargo-deny@0.20.2
7482

7583
- name: Check dependency licenses (Apache-compatible)
7684
run: cargo deny check licenses
7785

86+
# The inventory ships with the source release, so a stale one is worse than none.
87+
- name: Dependency inventory drift check
88+
run: |
89+
cargo fetch --locked
90+
python3 scripts/dependencies.py verify
91+
92+
# release.sh archives this subtree and nothing else inspects the result;
93+
# the crate is covered by rust-release.yml before it publishes.
94+
- name: Source release contents
95+
run: |
96+
git archive --prefix=t/ HEAD | tar -t > "${RUNNER_TEMP}/tarball.txt"
97+
for f in LICENSE NOTICE DEPENDENCIES.rust.tsv; do
98+
grep -qxF "t/$f" "${RUNNER_TEMP}/tarball.txt" || {
99+
echo "::error::source release is missing $f"
100+
exit 1
101+
}
102+
done
103+
78104
- name: Rust Cache
79105
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
80106
with:

.github/workflows/rust-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444

4545
# cargo packs only the crate directory, so the LICENSE/NOTICE above it
4646
# never reach the .crate.
47-
- name: Verify LICENSE and NOTICE in the crate
47+
- name: Verify LICENSE, NOTICE and the dependency inventory in the crate
4848
run: |
4949
FILES=$(cargo package --list --allow-dirty -p fluss-rs)
50-
for f in LICENSE NOTICE; do
50+
for f in LICENSE NOTICE DEPENDENCIES.rust.tsv; do
5151
if ! echo "$FILES" | grep -qx "$f"; then
5252
echo "Error: ${f} is missing from the fluss-rs crate"
5353
exit 1

0 commit comments

Comments
 (0)