Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 39 additions & 36 deletions .github/workflows/crates.yml
Original file line number Diff line number Diff line change
@@ -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 }}
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand All @@ -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**
```
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2022-11-02"
2 changes: 1 addition & 1 deletion tinydancer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tinydancer"
version = "0.0.8"
version = "0.0.9"
edition = "2021"
default-run = "tinydancer"
authors = ["Anoushk Kharangate <kharangateanoushk04@email.com>","Harsh Patel <hp80738@gmail.com>"]
Expand Down