diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7d52dc..7291ca3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,70 +10,40 @@ permissions: contents: read jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - env: - RUSTFLAGS: '-Dwarnings' - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy, rustfmt - target: wasm32-unknown-unknown + rust: + name: Rust + uses: RustForWeb/.github/.github/workflows/rust.yml@373c25f8fd29e10c40f1343f13312f8be3514af0 + with: + enable-test: false + target: wasm32-unknown-unknown - - name: Install Cargo Binary Install - uses: cargo-bins/cargo-binstall@main - - - name: Install crates - run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort - - - name: Lint - run: cargo clippy --all-features --locked - - - name: Check dependencies - run: cargo deny check - - - name: Check unused dependencies - run: cargo machete - - - name: Check manifest formatting - run: cargo sort --workspace --check - - - name: Check formatting - run: cargo fmt --all --check test: name: Test runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0 with: - components: clippy, rustfmt target: wasm32-unknown-unknown + components: rust-src - name: Install Cargo Binary Install - uses: cargo-bins/cargo-binstall@main + uses: cargo-bins/cargo-binstall@dc19f1e48450eefe5a29b8da6c6b00a87d730b37 # v1.18.1 - - name: Install Trunk - run: cargo binstall --force -y trunk + - name: Install crates + run: cargo binstall -y --force trunk - name: Set up Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: 'lts/*' - name: Set up pnpm - uses: pnpm/action-setup@v5 + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 with: version: 'latest' @@ -81,7 +51,7 @@ jobs: run: cargo test --all-features --locked --release - name: Upload visual snapshot diffs - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always() with: name: visual-snapshots-diff diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 51b6d84..9bbf74f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,34 +4,11 @@ on: release: types: [published] +permissions: + contents: read + id-token: write + jobs: publish: name: Publish - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: wasm32-unknown-unknown - - - name: Install Cargo Binary Install - uses: cargo-bins/cargo-binstall@main - - - name: Install crates - run: cargo binstall --force -y cargo-workspaces - - - uses: rust-lang/crates-io-auth-action@v1 - id: auth - - - name: Publish - run: cargo workspaces publish --publish-as-is - env: - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + uses: RustForWeb/.github/.github/workflows/publish.yml@373c25f8fd29e10c40f1343f13312f8be3514af0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a24759..f4e5429 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,68 +18,6 @@ permissions: jobs: release: name: Release - runs-on: ubuntu-latest - - steps: - - name: Generate GitHub App token - id: app-token - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: wasm32-unknown-unknown - - - name: Install Cargo Binary Install - uses: cargo-bins/cargo-binstall@main - - - name: Install crates - run: cargo binstall --force -y cargo-workspaces toml-cli - - - name: Bump version - run: cargo workspaces version --all --no-git-commit --yes ${{ inputs.bump }} - - - name: Extract version - id: extract-version - run: echo "VERSION=v$(toml get Cargo.toml workspace.package.version --raw)" >> "$GITHUB_OUTPUT" - - - name: Add changes - run: git add . - - - name: Commit - id: commit - uses: dsanders11/github-app-commit-action@v2 - with: - message: ${{ steps.extract-version.outputs.VERSION }} - token: ${{ steps.app-token.outputs.token }} - - - name: Reset and pull - run: git reset --hard && git pull - - - name: Tag - uses: actions/github-script@v9 - env: - GIT_TAG: ${{ steps.extract-version.outputs.VERSION }} - GIT_SHA: ${{ steps.commit.outputs.sha }} - with: - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: `refs/tags/${process.env.GIT_TAG}`, - sha: process.env.GIT_SHA - }) - - - name: Release - uses: softprops/action-gh-release@v3 - with: - generate_release_notes: true - make_latest: true - tag_name: ${{ steps.extract-version.outputs.VERSION }} - token: ${{ steps.app-token.outputs.token }} + uses: RustForWeb/.github/.github/workflows/release.yml@373c25f8fd29e10c40f1343f13312f8be3514af0 + with: + bump: ${{ inputs.bump }} diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 811ff59..0f5ca1e 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -1,4 +1,5 @@ name: Website + on: pull_request: {} push: @@ -7,104 +8,14 @@ on: permissions: contents: read + id-token: write + pages: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false jobs: - book-test: - name: Test Book - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: wasm32-unknown-unknown - - - name: Install Cargo Binary Install - uses: cargo-bins/cargo-binstall@main - - - name: Install mdBook - run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk - - - name: Run tests - run: mdbook test - working-directory: book - - book-build: - name: Build Book - needs: book-test - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: wasm32-unknown-unknown - - - name: Install Cargo Binary Install - uses: cargo-bins/cargo-binstall@main - - - name: Install mdBook and Trunk - run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk trunk - - - name: Install Node.js dependencies - run: npm ci - - - name: Build Book - run: mdbook build - working-directory: book - - - name: Combine Book Outputs - run: mdbook-trunk combine - working-directory: book - - - name: Upload artifact - uses: actions/upload-artifact@v7 - with: - name: book - path: book/dist - retention-days: 1 - if-no-files-found: error - - deploy: - name: Deploy - needs: book-build - if: github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - - permissions: - contents: read - pages: write - id-token: write - - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Download artifacts - uses: actions/download-artifact@v8 - with: - path: dist - merge-multiple: true - - - name: Setup Pages - uses: actions/configure-pages@v6 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v5 - with: - path: dist - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v5 + book: + name: Book + uses: RustForWeb/.github/.github/workflows/book.yml@373c25f8fd29e10c40f1343f13312f8be3514af0 diff --git a/Cargo.lock b/Cargo.lock index d0925ad..08baa9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1613,7 +1613,6 @@ version = "0.7.0" dependencies = [ "dioxus", "floating-ui-dom", - "wasm-bindgen-test", "web-sys", ] @@ -1707,7 +1706,6 @@ name = "floating-ui-yew" version = "0.7.0" dependencies = [ "floating-ui-dom", - "wasm-bindgen-test", "web-sys", "yew", ] diff --git a/packages/dioxus/Cargo.toml b/packages/dioxus/Cargo.toml index 9a9cf54..8159d99 100644 --- a/packages/dioxus/Cargo.toml +++ b/packages/dioxus/Cargo.toml @@ -15,4 +15,4 @@ floating-ui-dom.workspace = true web-sys.workspace = true [dev-dependencies] -wasm-bindgen-test.workspace = true +# wasm-bindgen-test.workspace = true diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index ef97920..e8420c6 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -15,4 +15,4 @@ web-sys.workspace = true yew.workspace = true [dev-dependencies] -wasm-bindgen-test.workspace = true +# wasm-bindgen-test.workspace = true