Merge pull request #172 from code0-tech/fix/reset-cargo-version #40
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: Publish code0-flow crate | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: full | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: packages | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup rust | |
| run: | | |
| rustup update --no-self-update stable | |
| rustup component add rustfmt clippy | |
| - name: Install protoc | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| protoc --version | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Check crate | |
| run: cargo check --locked --all-targets --features all | |
| - name: Run clippy | |
| run: cargo clippy --locked --all-targets --features all -- -D warnings | |
| - name: Run tests | |
| run: cargo test --locked --features all | |
| - name: Set version | |
| run: sed -i "s/version = \"0.0.0\"/version = \"${{ github.ref_name }}\"/" Cargo.toml | |
| - name: Cargo Login | |
| run: cargo login ${{secrets.CARGO_REGISTRY_TOKEN}} | |
| - name: Publish crate | |
| run: cargo publish --allow-dirty |