Skip to content

Prepare 0.20.0 release #1

Prepare 0.20.0 release

Prepare 0.20.0 release #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
env:
CARGO_TERM_COLOR: always
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Install system dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libsoapysdr-dev
- name: Validate tag matches crate version
run: |
tag_version="${GITHUB_REF_NAME#v}"
crate_version="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')"
if [ "$tag_version" != "$crate_version" ]; then
echo "Tag $GITHUB_REF_NAME does not match crate version $crate_version"
exit 1
fi
- name: Check format
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets --workspace --features=rtlsdr,aaronia_http,soapy -- -D warnings
- name: Run tests
run: cargo test --all-targets --features=aaronia_http,rtlsdr,soapy
- name: Run doc tests
run: cargo test --doc --features=aaronia_http,rtlsdr,soapy
- name: Check public API docs
run: cargo doc --no-deps --features=aaronia_http,rtlsdr,soapy
- name: Package crate
run: cargo package
- name: Authenticate with crates.io
id: auth
uses: rust-lang/crates-io-auth-action@v1
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" \
--verify-tag \
--title "$GITHUB_REF_NAME" \
--generate-notes