zsmtp 0.1.0

A zero-knowledge SMTP mail transfer agent prototype
Documentation
---
name: Test & Build

on:
  push:
    branches:
      - '*'
  workflow_dispatch:

permissions:
  contents: write

jobs:
  test:
    uses: ./.github/workflows/test.yml

  coverage:
    uses: ./.github/workflows/coverage.yml
    secrets: inherit

  build:
    name: Build
    runs-on: ${{ matrix.os }}
    needs:
      - test

    strategy:
      matrix:
        include:
          - build: linux
            os: ubuntu-latest
            target: x86_64-unknown-linux-musl

          - build: macos
            os: macos-latest
            target: x86_64-apple-darwin

    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Get package name from Cargo.toml
        id: package
        shell: bash
        run: |
          PACKAGE_NAME=$(awk -F '"' '/^name = / {print $2; exit}' Cargo.toml)
          echo "name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
          echo "Package name: $PACKAGE_NAME"

      - name: Branch name
        run: echo "${GITHUB_REF##*/}"

      - name: Get the release version from the tag
        run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

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

      - run: sudo apt -y install musl-dev musl-tools
        if: matrix.build == 'linux'

      - name: Build (Linux musl)
        if: matrix.build == 'linux'
        run: cargo build --release --locked --target ${{ matrix.target }}

      - name: Build
        if: matrix.build != 'linux'
        run: cargo build --release --locked --target ${{ matrix.target }}