fix release workflows #99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cache: 2025-08-20 16:50:00 | |
| name: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| ci_test: | |
| name: Test on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| rust: [stable] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: rustfmt, clippy, llvm-tools-preview | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| cache-dependency-path: renamify-core/pnpm-lock.yaml | |
| - name: Install renamify-core dependencies | |
| run: | | |
| cd renamify-core | |
| pnpm install | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| if: runner.os != 'Windows' | |
| run: cargo fmt --all -- --check | |
| - name: Check whitespace | |
| if: runner.os != 'Windows' | |
| run: ./scripts/check-whitespace.sh | |
| - name: Run clippy | |
| if: runner.os != 'Windows' | |
| run: cargo clippy --all-targets --all-features | |
| - name: Install cargo-llvm-cov | |
| run: | | |
| # Install compatible version for Rust 1.80.1 | |
| cargo install cargo-llvm-cov --version 0.6.15 | |
| - name: Run tests with coverage | |
| run: cargo llvm-cov --workspace --lcov --output-path lcov-${{ matrix.os }}.info | |
| - name: Verify TypeScript bindings were generated | |
| if: runner.os == 'Linux' | |
| run: | | |
| if [ ! -d "renamify-core/bindings" ] || [ -z "$(ls -A renamify-core/bindings/*.d.ts 2>/dev/null)" ]; then | |
| echo "Error: TypeScript bindings were not generated" | |
| exit 1 | |
| fi | |
| echo "TypeScript bindings found:" | |
| ls -la renamify-core/bindings/*.d.ts | |
| - name: Upload TypeScript bindings | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: typescript-bindings | |
| path: renamify-core/bindings/ | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./lcov-${{ matrix.os }}.info | |
| flags: ${{ runner.os }} | |
| name: codecov-${{ matrix.os }} | |
| fail_ci_if_error: false | |
| - name: Build release binary | |
| run: cargo build --release --verbose | |
| - name: Upload release binary (Linux) | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: renamify-linux-x64 | |
| path: target/release/renamify | |
| - name: Upload release binary (macOS) | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: renamify-macos-x64 | |
| path: target/release/renamify | |
| - name: Upload release binary (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: renamify-windows-x64 | |
| path: target/release/renamify.exe | |
| ci_msrv: | |
| name: Check MSRV | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust 1.80.1 | |
| uses: dtolnay/rust-toolchain@1.80.1 | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check MSRV | |
| run: | | |
| # Downgrade half package for MSRV compatibility | |
| cargo update half@2.6.0 --precise 2.4.1 || true | |
| cargo check --all-targets |