devolutions-crypto 0.9.2

An abstraction layer for the cryptography used by Devolutions
Documentation
name: Native Build Windows
description: This builds the windows native libraries
runs:
  using: composite
  steps:
    - name: Download Config
      uses: actions/download-artifact@v4
      with:
        name: config.txt
        path: ./wrappers/csharp

    - name: Installing rust targets
      shell: bash
      run: |
        rustup update
        rustup target add x86_64-pc-windows-msvc
        rustup target add i686-pc-windows-msvc
        rustup target add aarch64-pc-windows-msvc

    - name: Unit tests
      working-directory: ./
      shell: bash
      run: |
        cargo test

    - name: Build Windows Natives
      working-directory: ./wrappers/csharp
      shell: bash
      run: |
        cargo build -p devolutions-crypto-ffi --release --target=x86_64-pc-windows-msvc
        cargo build -p devolutions-crypto-ffi --release --target=i686-pc-windows-msvc
        cargo build -p devolutions-crypto-ffi --release --target=aarch64-pc-windows-msvc

    - name: Copy Windows Natives
      shell: bash
      run: |
        mkdir ./wrappers/csharp/windows

        cp ./target/x86_64-pc-windows-msvc/release/devolutions_crypto_ffi.dll ./wrappers/csharp/windows/DevolutionsCrypto-x64.dll
        cp ./target/i686-pc-windows-msvc/release/devolutions_crypto_ffi.dll ./wrappers/csharp/windows/DevolutionsCrypto-x86.dll
        cp ./target/aarch64-pc-windows-msvc/release/devolutions_crypto_ffi.dll ./wrappers/csharp/windows/DevolutionsCrypto-arm64.dll

    - name:  Building DOTNET CORE
      working-directory: ./wrappers/csharp
      shell: bash
      run: |
        VERSION_MANAGED=$(grep 'version' config.txt | cut -d '=' -f2 | tr -d ' "')
        VERSION_NATIVE=$(grep 'package.version = "' ../../Cargo.toml | cut -d '"' -f2)

        sed -i -e "s/||MANAGED_VERSION||/${VERSION_MANAGED}/g" -e "s/||NATIVE_VERSION||/${VERSION_NATIVE}/g" ./src/Native.cs        
        
        dotnet build ./src/devolutions-crypto.csproj -p:Version="$VERSION_MANAGED" --configuration Release --output ./dotnet-core/bin

    - uses: actions/upload-artifact@v4.3.6
      with:
        name: native-windows
        path: |
          wrappers/csharp/windows/**
          wrappers/csharp/dotnet-core/**