diff --git a/.github/workflows/crates.yml b/.github/workflows/crates.yml index 08ffc7e..db48d07 100644 --- a/.github/workflows/crates.yml +++ b/.github/workflows/crates.yml @@ -1,51 +1,54 @@ +name: Build the client + on: push: - branch: ["master"] - -name: Publish to crates.io - -env: - CRATES_DEPLOY: false + branches: ["master", "fix/build-and-onboarding"] + pull_request: + workflow_dispatch: jobs: - build_and_test: + build: name: Build the client - runs-on: ubuntu-latest - environment: dev + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Install Nightly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + build-essential pkg-config libssl-dev libudev-dev \ + zlib1g-dev llvm clang cmake make libprotobuf-dev protobuf-compiler - - run: rustup toolchain list - - uses: actions-rs/cargo@v1 + - name: Install pinned Rust toolchain + uses: dtolnay/rust-toolchain@master with: - command: build - args: --release --all-features + toolchain: nightly-2022-11-02 - check_and_publish: - name: Check semver and publish to crates.io - runs-on: ubuntu-latest - environment: dev + - name: Cargo build cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Build release + run: cargo build --release --all-features + + # Publishing to crates.io is a maintainer action and is intentionally + # disabled here; kept for reference. + publish: + name: Publish to crates.io (disabled) + if: false + runs-on: ubuntu-22.04 steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Nightly toolchain - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal - toolchain: nightly - override: true - - - name: Publish to crates.io - if: "contains(${{ env.CRATES_DEPLOY }},'true')" + toolchain: nightly-2022-11-02 + - name: Publish run: cargo publish -p tinydancer --token ${CRATES_TOKEN} --no-verify env: - CRATES_DEPLOY: ${{ secrets.CRATES_DEPLOY }} CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} diff --git a/README.md b/README.md index 8178030..eec673b 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,19 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh Note: For Windows download rustup from this [link](https://forge.rust-lang.org/infra/other-installation-methods.html#other-ways-to-install-rustup) **Configure Toolchain** + +This repo pins the required Rust toolchain in `rust-toolchain.toml` +(`nightly-2022-11-02`). `rustup` installs and selects it automatically on the +first `cargo` invocation — no manual `rustup default` needed. + +The pin is required: `tinydancer` uses nightly-only feature gates +(`async_closure`, `mutex_unlock`) that newer nightlies have removed, so a current +toolchain will not compile it. + +**Linux system dependencies** (Ubuntu/Debian) ``` -rustup default nightly +sudo apt-get install -y build-essential pkg-config libssl-dev libudev-dev \ + zlib1g-dev llvm clang cmake make libprotobuf-dev protobuf-compiler ``` **Build and Add to Path** @@ -29,7 +40,7 @@ cargo b -r && cp ./target/release/tinydancer ~/.local/bin/ ``` **Or Install Using Cargo** ``` -cargo install --git https://github.com/tinydancer-io/half-baked-client tinydancer +cargo install --git https://github.com/tinydancer-io/tinydancer tinydancer ``` **Confirm Installation** ``` diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..226063b --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly-2022-11-02" diff --git a/tinydancer/Cargo.toml b/tinydancer/Cargo.toml index 2a1b231..cacb3c0 100644 --- a/tinydancer/Cargo.toml +++ b/tinydancer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tinydancer" -version = "0.0.8" +version = "0.0.9" edition = "2021" default-run = "tinydancer" authors = ["Anoushk Kharangate ","Harsh Patel "]