temp-converter 1.1.4

Simple terminal temperature unit converter between Celsius, Fahrenheit and Kelvin.
Documentation
name: Cargo Build, Test & Release

on:
  push:
    branches:
      - 'main'
  pull_request:
    branches:
      - 'main'

env:
  CARGO_TERM_COLOR: always

jobs:
  build_and_test:
    name: Rust project - latest
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
          - beta
          - nightly

    steps:
      - uses: actions/checkout@v3

      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.rust }}
          override: true
          components: rustfmt, clippy

      - uses: actions-rs/cargo@v1
        with:
          command: build

      - uses: actions-rs/cargo@v1
        with:
          command: test

      - uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check

      - uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: -- -D warnings

  publish:
    name: Publish for ${{ matrix.os }}
    needs: build_and_test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            artifact_name: temp-converter
            asset_name: temp-converter-linux
          - os: windows-latest
            artifact_name: temp-converter.exe
            asset_name: temp-converter-windows.exe
          - os: macos-latest
            artifact_name: temp-converter
            asset_name: temp-converter-macos

    steps:
      - uses: actions/checkout@v3
      - name: Get toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
      - name: Get tag
        id: get_tag
        shell: bash
        run: |
          tag=$(echo -n v ; cargo pkgid | cut -d "@" -f2)
          echo "tag=$tag" >> $GITHUB_OUTPUT
      - name: Build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --release
      - name: Upload binaries to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: target/release/${{ matrix.artifact_name }}
          asset_name: ${{ matrix.asset_name }}
          tag: ${{ steps.get_tag.outputs.tag }}