Skip to content

Commit 4f38ca6

Browse files
committed
fix(ci): make crates.io publish idempotent and add missing oui.gz to Docker build
1 parent a2577ac commit 4f38ca6

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ jobs:
2626
- name: Publish to crates.io
2727
env:
2828
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
29-
run: cargo publish
29+
run: |
30+
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
31+
NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
32+
# Check if this version already exists on crates.io
33+
if cargo search "$NAME" --limit 1 | grep -q "\"$VERSION\""; then
34+
echo "⚠️ $NAME@$VERSION already published to crates.io, skipping"
35+
else
36+
cargo publish
37+
fi

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ COPY resources/ebpf/vmlinux ./resources/ebpf/vmlinux
3131
COPY src ./src
3232
COPY benches ./benches
3333
COPY assets/services ./assets/services
34+
COPY assets/oui.gz ./assets/oui.gz
3435

3536
# Build the application in release mode (eBPF is enabled by default on Linux)
3637
RUN cargo build --release

0 commit comments

Comments
 (0)