This repository was archived by the owner on May 31, 2026. It is now read-only.
Publish Crate #2
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: Publish Crate | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Expected crate version to publish | |
| required: true | |
| default: 0.1.0 | |
| dry_run: | |
| description: Run cargo publish --dry-run instead of publishing | |
| required: true | |
| type: boolean | |
| default: true | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: publish-crate-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| run: | | |
| rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy | |
| rustup default 1.95.0 | |
| - name: Validate crate version | |
| run: | | |
| grep -q '^name = "omena-resolver"$' Cargo.toml | |
| grep -q '^version = "${{ inputs.version }}"$' Cargo.toml | |
| - name: Cargo fmt | |
| run: cargo fmt --all --check | |
| - name: Cargo test | |
| run: cargo test | |
| - name: Cargo clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Cargo publish dry-run | |
| run: cargo publish --dry-run | |
| - name: Cargo publish | |
| if: ${{ !inputs.dry_run }} | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
| run: | | |
| test -n "${CARGO_REGISTRY_TOKEN:-}" | |
| cargo publish |