oxismet 1.3.0

A mass encryption tool for servers
name: Build For Release

on:
  push:
    tags:
      - v*
jobs:
  build:
    name: Build ${{ matrix.arch }}-${{ matrix.os_name }}
    runs-on: ${{ matrix.runner_os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          # Linux x86_64
          - arch: x86_64
            os_name: linux
            runner_os: ubuntu-latest
            target: x86_64-unknown-linux-musl
            suffix: ""

          # Linux aarch64
          - arch: aarch64
            os_name: linux
            runner_os: ubuntu-latest
            target: aarch64-unknown-linux-musl
            suffix: ""

          # Windows x86_64
          - arch: x86_64
            os_name: windows
            runner_os: windows-latest
            target: x86_64-pc-windows-msvc
            suffix: .exe

          # Windows aarch64
          - arch: aarch64
            os_name: windows
            runner_os: windows-latest
            target: aarch64-pc-windows-msvc
            suffix: .exe

          # macOS x86_64
          - arch: x86_64
            os_name: macos
            runner_os: macos-latest
            target: x86_64-apple-darwin
            suffix: ""

          # macOS aarch64
          - arch: aarch64
            os_name: macos
            runner_os: macos-latest
            target: aarch64-apple-darwin
            suffix: ""

    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Install cross
        if: matrix.os_name == 'linux' && matrix.arch == 'aarch64'
        run: cargo install cross

      - name: Build (cross)
        if: matrix.os_name == 'linux' && matrix.arch == 'aarch64'
        run: cross build --release --target ${{ matrix.target }}

      - name: Build
        if: "!(matrix.os_name == 'linux' && matrix.arch == 'aarch64')"
        run: cargo build --release --target ${{ matrix.target }}

      - name: Prepare binary
        run: |
          mkdir -p dist
          cp target/${{ matrix.target }}/release/oxismet${{matrix.suffix}} dist/oxismet-${{ matrix.arch }}-${{matrix.os_name}}${{ matrix.suffix }}
      - name: Upload to Release
        uses: softprops/action-gh-release@v1
        with:
          files: dist/*
          name: ${{ github.ref_name }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}