name: Publich on crates.io
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- name: Install bevy dependencies
run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev
- name: Run Clippy (Linting)
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
- name: Run Simple Example
uses: actions-rs/cargo@v1
with:
command: run
args: --all-features --example simple
- name: Run no_std Example
uses: actions-rs/cargo@v1
with:
command: run
args: --no-default-features --features bevy --example no_std
- name: Run Tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets --all-features --release
- name: Install toml-cli
run: cargo install toml-cli
- name: Check version
run: test "v$(toml get -r Cargo.toml package.version)" = "${{ github.ref_name }}"
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}