Skip to content

Commit 662ed3a

Browse files
committed
chore: publish via cargo publish run step for scorecard packaging
1 parent 1f7c842 commit 662ed3a

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,27 @@ jobs:
2424
- name: Run tests
2525
run: cargo test --workspace --all-features
2626

27-
- name: Publish to crates.io
28-
uses: katyo/publish-crates@02cc2f1ad653fb25c7d1ff9eb590a8a50d06186b # v2
29-
with:
30-
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
27+
# Plain `cargo publish` (not a wrapper action) so Scorecard credits
28+
# Packaging. Publish sys before the crate that depends on it; skip either
29+
# if that version is already on crates.io (re-runs, or an unchanged member).
30+
- name: Publish litehtml-sys to crates.io
31+
run: |
32+
ver=$(cargo pkgid -p litehtml-sys | sed 's/.*[@#]//')
33+
if curl -sf -A "litehtml-rs-ci (mail@gofranz.com)" https://index.crates.io/li/te/litehtml-sys | grep -q "\"vers\":\"$ver\""; then
34+
echo "litehtml-sys $ver already published, skipping"
35+
else
36+
cargo publish -p litehtml-sys --locked
37+
fi
38+
env:
39+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
40+
41+
- name: Publish litehtml to crates.io
42+
run: |
43+
ver=$(cargo pkgid -p litehtml | sed 's/.*[@#]//')
44+
if curl -sf -A "litehtml-rs-ci (mail@gofranz.com)" https://index.crates.io/li/te/litehtml | grep -q "\"vers\":\"$ver\""; then
45+
echo "litehtml $ver already published, skipping"
46+
else
47+
cargo publish -p litehtml --locked
48+
fi
49+
env:
50+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)