Skip to content

Rust building

Rust building #247

Workflow file for this run

name: Build Rust
run-name: Rust building
on: [push, pull_request]
permissions:
contents: write
pull-requests: read
jobs:
builds:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
continue-on-error: true
- name: Build
run: cargo build --release --features mdns
release:
if: ${{ contains(github.ref, 'tags/v') }}
needs: [builds]
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
continue-on-error: true
- name: login
run: cargo login ${{ secrets.CARGO_TOKEN }}
- name: publish proto
continue-on-error: true
run: cargo publish -p lebai-proto
- name: publish lebai_sdk
run: cargo publish -p lebai_sdk