Skip to content

GitHub Action: Bump softprops/action-gh-release from 2 to 3 #55

GitHub Action: Bump softprops/action-gh-release from 2 to 3

GitHub Action: Bump softprops/action-gh-release from 2 to 3 #55

Workflow file for this run

name: Check + Test
on: [push]
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Install OS dependencies
run: sudo apt-get install libdbus-1-dev libusb-1.0-0-dev pkg-config
shell: bash
- name: Setup Rust toolchain
run: |
rustup toolchain install stable --profile minimal --no-self-update -c clippy -c rustfmt
rustup default stable
shell: bash
- name: "Print Rust toolchain version"
run: rustc --version --verbose
shell: bash
- name: "Get version"
id: version
run: |
REF="${{ github.ref }}"
if [[ "$REF" =~ ^refs/tags/v ]] ; then
version=${REF#refs/tags/v}
# checks
grep "version = \"$version\"" Cargo.toml > /dev/null
else
version=unreleased
fi
echo "version=$version" >> $GITHUB_OUTPUT
echo "Version: $version"
shell: bash
- uses: Swatinem/rust-cache@v2
- name: Fmt
run: cargo fmt --all -- --check
shell: bash
- name: Clippy
run: cargo clippy -- -D warnings
shell: bash
- name: Test
run: cargo test --release
shell: bash
- name: Create Release
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
name: Release ${{ steps.version.outputs.version }}
draft: true