Skip to content

Commit 8f360f9

Browse files
committed
ci: add clippy check and publish domparser crate on release
1 parent 4b0d6b8 commit 8f360f9

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/CI.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,29 @@ permissions:
2020
- docs/**
2121
pull_request: null
2222
jobs:
23+
clippy:
24+
name: Clippy
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Install
29+
uses: dtolnay/rust-toolchain@stable
30+
with:
31+
toolchain: stable
32+
components: clippy
33+
- name: Cache cargo
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/registry/index/
38+
~/.cargo/registry/cache/
39+
~/.cargo/git/db/
40+
.cargo-cache
41+
target/
42+
key: clippy-cargo-${{ runner.os }}
43+
- name: Run clippy
44+
run: cargo clippy --all-targets --all-features -- -D warnings
45+
2346
build:
2447
strategy:
2548
fail-fast: false
@@ -381,6 +404,7 @@ jobs:
381404
then
382405
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
383406
npm publish --access public --provenance
407+
cargo publish -p domparser --token $CARGO_REGISTRY_TOKEN
384408
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
385409
then
386410
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
@@ -390,4 +414,5 @@ jobs:
390414
fi
391415
env:
392416
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
393-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
417+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
418+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)