osc-cost 0.8.0

osc-cost helps measuring OUTSCALE infrastructure costs
Documentation
name: release

on:
  push:
    tags:
      - v*
  workflow_dispatch:  

permissions:
  contents: write

jobs:
  release:
      runs-on: ubuntu-latest
      steps:
        - name: Checkout
          uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
          with:
            fetch-depth: 0

        - name: Create Release
          uses: softprops/action-gh-release@26994186c0ac3ef5cae75ac16aa32e8153525f77
          if: startsWith(github.ref, 'refs/tags/')
          with:
            tag_name: ${{ github.ref_name }}
            name: Release ${{ github.ref_name }}
            draft: true
            prerelease: false
            generate_release_notes: true
  artefact:
    strategy:
          matrix:
            include:
              - name: Linux x86_64
                os: ubuntu-latest
                target: x86_64-unknown-linux-musl
                suffix: ''
              - name: macOS M1
                os: macos-latest
                target: aarch64-apple-darwin
                suffix: ''
              - name: Windows
                os: windows-latest
                target: x86_64-pc-windows-msvc
                suffix: .exe
    runs-on: ${{ matrix.os }}
    name: Create artefact for ${{ matrix.name }}
    needs: [release]
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
      - name: Stable Rust
        uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
        with:
          toolchain: stable
          targets: ${{ matrix.target }}
      - name: Install musl-tools
        run: sudo apt update -y && sudo apt install musl-tools -y
        if: matrix.os == 'ubuntu-latest'
      - name: Build
        run: cargo build --target ${{ matrix.target }} --release --locked
      - name: Move binary
        run: mv target/${{ matrix.target }}/release/osc-cost${{ matrix.suffix }} osc-cost-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.suffix }}
      - name: Upload Artefact to release
        uses: softprops/action-gh-release@26994186c0ac3ef5cae75ac16aa32e8153525f77
        if: startsWith(github.ref, 'refs/tags/')
        with:
          tag_name: ${{ github.ref_name }}
          name: Release ${{ github.ref_name }}
          draft: true
          prerelease: false
          files: osc-cost-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.suffix }}