cpkg 0.12.1

A dead simple C package manager.
name: Release

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
  release:
    strategy:
      matrix:
        config:
          - { os: ubuntu-latest, bin: target/x86_64-unknown-linux-gnu/release/cpkg, target: "x86_64-unknown-linux-gnu" }
          - { os: windows-latest, bin: target/x86_64-pc-windows-msvc/release/cpkg.exe, target: "x86_64-pc-windows-msvc" }
          - { os: windows-latest, bin: target/i686-pc-windows-msvc/release/cpkg.exe, target: "i686-pc-windows-msvc" }

    runs-on: ${{ matrix.config.os }}
    steps:
      - uses: actions/checkout@v4

      - name: Build
        run: |
          rustup target add ${{ matrix.config.target }}
          cargo build --target ${{ matrix.config.target }} --release

      - name: Rename (Linux)
        if: runner.os == 'Linux'
        run: mv ${{ matrix.config.bin }} cpkg-${{ github.ref_name }}-${{ matrix.config.target }}

      - name: Rename (Windows)
        if: runner.os == 'Windows'
        run: move ${{ matrix.config.bin }} cpkg-${{ github.ref_name }}-${{ matrix.config.target }}.exe

      - name: Upload (Linux)
        if: runner.os == 'Linux'
        uses: softprops/action-gh-release@v2
        with:
          files: cpkg-${{ github.ref_name }}-${{ matrix.config.target }}

      - name: Upload (Windows)
        if: runner.os == 'Windows'
        uses: softprops/action-gh-release@v2
        with:
          files: cpkg-${{ github.ref_name }}-${{ matrix.config.target }}.exe