Skip to content

Commit 9e1a341

Browse files
ci: use reusable workflows (#133)
1 parent cab8257 commit 9e1a341

4 files changed

Lines changed: 19 additions & 147 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,8 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
lint:
14-
name: Lint
15-
runs-on: ubuntu-latest
16-
17-
env:
18-
RUSTFLAGS: '-Dwarnings'
19-
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23-
24-
- name: Set up Rust toolchain
25-
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
26-
with:
27-
components: clippy, rustfmt
28-
target: wasm32-unknown-unknown
29-
30-
- name: Install Cargo Binary Install
31-
uses: cargo-bins/cargo-binstall@dc19f1e48450eefe5a29b8da6c6b00a87d730b37 # v1.18.1
32-
33-
- name: Install crates
34-
run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort
35-
36-
- name: Lint
37-
run: cargo clippy --all-features --locked
38-
39-
- name: Check dependencies
40-
run: cargo deny check
41-
42-
- name: Check unused dependencies
43-
run: cargo machete
44-
45-
- name: Check manifest formatting
46-
run: cargo sort --workspace --check
47-
48-
- name: Check formatting
49-
run: cargo fmt --all --check
50-
51-
test:
52-
name: Test
53-
runs-on: ubuntu-latest
54-
55-
steps:
56-
- name: Checkout
57-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
58-
59-
- name: Set up Rust toolchain
60-
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
61-
with:
62-
components: clippy, rustfmt
63-
target: wasm32-unknown-unknown
64-
65-
- name: Test
66-
run: cargo test --all-features --locked --release
13+
rust:
14+
name: Rust
15+
uses: RustForWeb/.github/.github/workflows/rust.yml@373c25f8fd29e10c40f1343f13312f8be3514af0
16+
with:
17+
target: wasm32-unknown-unknown

.github/workflows/publish.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,13 @@ on:
44
release:
55
types: [published]
66

7+
permissions:
8+
contents: read
9+
id-token: write
10+
711
jobs:
812
publish:
913
name: Publish
10-
runs-on: ubuntu-latest
11-
12-
permissions:
13-
contents: read
14-
id-token: write
15-
16-
steps:
17-
- name: Checkout
18-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19-
20-
- name: Set up Rust toolchain
21-
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
22-
with:
23-
target: wasm32-unknown-unknown
24-
25-
- name: Install Cargo Binary Install
26-
uses: cargo-bins/cargo-binstall@dc19f1e48450eefe5a29b8da6c6b00a87d730b37 # v1.18.1
27-
28-
- name: Install crates
29-
run: cargo binstall --force -y cargo-workspaces
30-
31-
- uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
32-
id: auth
33-
34-
- name: Publish
35-
run: cargo workspaces publish --publish-as-is
36-
env:
37-
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
14+
uses: RustForWeb/.github/.github/workflows/publish.yml@373c25f8fd29e10c40f1343f13312f8be3514af0
15+
with:
16+
target: wasm32-unknown-unknown

.github/workflows/release.yml

Lines changed: 4 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,7 @@ permissions:
1818
jobs:
1919
release:
2020
name: Release
21-
runs-on: ubuntu-latest
22-
23-
steps:
24-
- name: Generate GitHub App token
25-
id: app-token
26-
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
27-
with:
28-
client-id: ${{ secrets.APP_ID }}
29-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
30-
31-
- name: Checkout
32-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33-
34-
- name: Set up Rust toolchain
35-
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
36-
with:
37-
target: wasm32-unknown-unknown
38-
39-
- name: Install Cargo Binary Install
40-
uses: cargo-bins/cargo-binstall@dc19f1e48450eefe5a29b8da6c6b00a87d730b37 # v1.18.1
41-
42-
- name: Install crates
43-
run: cargo binstall --force -y cargo-workspaces toml-cli
44-
45-
- name: Bump version
46-
run: cargo workspaces version --all --no-git-commit --yes ${{ inputs.bump }}
47-
48-
- name: Extract version
49-
id: extract-version
50-
run: echo "VERSION=v$(toml get Cargo.toml workspace.package.version --raw)" >> "$GITHUB_OUTPUT"
51-
52-
- name: Add changes
53-
run: git add .
54-
55-
- name: Commit
56-
id: commit
57-
uses: dsanders11/github-app-commit-action@2bbcd331016d8c950b05a24b56e7eb9cb50d545e # v2.1.0
58-
with:
59-
message: ${{ steps.extract-version.outputs.VERSION }}
60-
token: ${{ steps.app-token.outputs.token }}
61-
62-
- name: Reset and pull
63-
run: git reset --hard && git pull
64-
65-
- name: Tag
66-
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
67-
env:
68-
GIT_TAG: ${{ steps.extract-version.outputs.VERSION }}
69-
GIT_SHA: ${{ steps.commit.outputs.sha }}
70-
with:
71-
script: |
72-
github.rest.git.createRef({
73-
owner: context.repo.owner,
74-
repo: context.repo.repo,
75-
ref: `refs/tags/${process.env.GIT_TAG}`,
76-
sha: process.env.GIT_SHA
77-
})
78-
79-
- name: Release
80-
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
81-
with:
82-
generate_release_notes: true
83-
make_latest: true
84-
tag_name: ${{ steps.extract-version.outputs.VERSION }}
85-
token: ${{ steps.app-token.outputs.token }}
21+
uses: RustForWeb/.github/.github/workflows/release.yml@373c25f8fd29e10c40f1343f13312f8be3514af0
22+
with:
23+
bump: ${{ inputs.bump }}
24+
target: wasm32-unknown-unknown

packages/leptos-maybe-callback/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ license.workspace = true
88
repository.workspace = true
99
version.workspace = true
1010

11+
[package.metadata.cargo-machete]
12+
ignored = ["log"]
13+
1114
[dependencies]
1215
leptos.workspace = true
1316

0 commit comments

Comments
 (0)