release: v0.4.0 #66
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - run: cargo fmt --all --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings | |
| cov: | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: | | |
| cargo-llvm-cov | |
| cargo-nextest | |
| - run: mkdir -p target/llvm-cov | |
| - run: cargo llvm-cov nextest --workspace --all-targets --all-features --locked --fail-under-regions 90 --codecov --output-path target/llvm-cov/codecov.json | |
| - if: github.ref_type != 'tag' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| use_oidc: true | |
| report_type: coverage | |
| disable_search: true | |
| files: target/llvm-cov/codecov.json | |
| - if: github.ref_type != 'tag' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| use_oidc: true | |
| report_type: test_results | |
| disable_search: true | |
| files: target/nextest/default/junit.xml | |
| draft: | |
| if: github.ref_type == 'tag' | |
| needs: | |
| - fmt | |
| - clippy | |
| - cov | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: taiki-e/create-gh-release-action@v1 | |
| with: | |
| draft: true | |
| binaries: | |
| needs: | |
| - draft | |
| permissions: | |
| id-token: write | |
| contents: write | |
| attestations: write | |
| artifact-metadata: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-24.04-arm | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-24.04-arm | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| - target: aarch64-pc-windows-msvc | |
| os: windows-11-arm | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| - uses: taiki-e/setup-cross-toolchain-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| - if: runner.os == 'macOS' | |
| run: brew install lld | |
| - uses: taiki-e/upload-rust-binary-action@v1 | |
| id: build | |
| with: | |
| bin: commit-lint | |
| archive: atypical-commit-$tag-$target | |
| package: atypical-commit | |
| locked: true | |
| target: ${{ matrix.target }} | |
| checksum: sha256 | |
| - uses: actions/attest@v4 | |
| with: | |
| subject-path: ${{ steps.build.outputs.archive }}.* | |
| release: | |
| needs: | |
| - binaries | |
| environment: publish | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: gh release edit "$GITHUB_REF_NAME" --draft=false | |
| cargo: | |
| needs: | |
| - release | |
| environment: publish | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - uses: rust-lang/crates-io-auth-action@v1 | |
| id: auth | |
| - run: cargo publish --workspace --all-features --locked | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | |
| npm: | |
| needs: | |
| - release | |
| environment: publish | |
| permissions: | |
| id-token: write | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: latest | |
| registry-url: https://registry.npmjs.org | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - run: bun npm/prepare.mjs "${GITHUB_REF_NAME#v}" | |
| - run: | | |
| for pkg in npm/platforms/*; do | |
| bunx npm publish "$pkg" | |
| done | |
| bunx npm publish npm |