From 1864fcec910c0399fe131cdff70d7346d821af2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABlle=20Huisman?= Date: Mon, 27 Apr 2026 16:31:28 +0200 Subject: [PATCH] ci: use reusable workflows --- .github/workflows/ci.yml | 52 ++------------------------- .github/workflows/publish.yml | 31 +++------------- .github/workflows/release.yml | 66 ++--------------------------------- 3 files changed, 11 insertions(+), 138 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 522a997..b4b982b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,52 +10,6 @@ permissions: contents: read jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy, rustfmt - - - 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 --all-targets --locked - - - name: Check dependencies - run: cargo deny check - - - name: Check unused dependencies - run: cargo machete --with-metadata - - - 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 - - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy, rustfmt - - - name: Test - run: cargo test --all-features --all-targets --locked --release + rust: + name: Rust + uses: RustForWeb/.github/.github/workflows/rust.yml@c18f3b7315df398b6af8d03f823e31daeda63114 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aa1f5da..823af00 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,32 +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 - - - 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@c18f3b7315df398b6af8d03f823e31daeda63114 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 860a8e0..1afcb04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,66 +18,6 @@ permissions: jobs: release: name: Release - runs-on: ubuntu-latest - - steps: - - name: Generate GitHub App token - id: app-token - uses: getsentry/action-github-app-token@v3 - with: - app_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 - - - 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 package.version --raw)" >> "$GITHUB_OUTPUT" - - - name: Add changes - run: git add . - - - name: Commit - id: commit - uses: dsanders11/github-app-commit-action@v1 - 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@v8 - 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@v2 - 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@c18f3b7315df398b6af8d03f823e31daeda63114 + with: + bump: ${{ inputs.bump }}