mpc-manager 0.1.1

A WebSocket Manager that facilitates secure communication between parties for multi party computation applications.
Documentation
name: Build and push release artifacts

on:
  release:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            target/
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Install cross
        run: cargo install cross

      - name: Build for Windows
        run: cross build --target x86_64-pc-windows-gnu --release
      - name: Archive Windows binary
        run: zip mpc-manager-x86_64-pc-windows-gnu.zip target/x86_64-pc-windows-gnu/release/mpc-manager.exe

      # Disabled due to cross not supporting Apple images, a custom dockerfile should be used

      # - name: Build for Mac
      #   run: cross build --target x86_64-apple-darwin --release
      # - name: Archive Mac binary
      #   run: zip mpc-manager-x86_64-apple-darwin.zip target/x86_64-apple-darwin/release/mpc-manager

      # - name: Build for Apple M1
      #   run: cross build --target aarch64-apple-darwin --release
      # - name: Archive Apple M1 binary
      #   run: zip mpc-manager-aarch64-apple-darwin.zip target/aarch64-apple-darwin/release/mpc-manager

      - name: Build for Linux
        run: cross build --target x86_64-unknown-linux-musl --release
      - name: Archive Linux binary
        run: tar -czvf mpc-manager-x86_64-unknown-linux-musl.tar.gz -C target/x86_64-unknown-linux-musl/release mpc-manager

      - name: Upload release assets
        uses: actions/upload-artifact@v2
        with:
          name: Release assets
          path: |
            mpc-manager-x86_64-pc-windows-gnu.zip
            mpc-manager-x86_64-unknown-linux-musl.tar.gz