name: Setup conan
description: Setup conan profile and artifactory

inputs:
  conan_profile:
    description: Conan profile name
    required: true

runs:
  using: composite
  steps:
    - name: Create conan profile on macOS
      if: ${{ runner.os == 'macOS' }}
      shell: bash
      run: |
        conan profile detect --name "${{ inputs.conan_profile }}" --force
        sed -i '' 's/compiler.cppstd=[^ ]*/compiler.cppstd=20/' "${{ env.CONAN_HOME }}/profiles/${{ inputs.conan_profile }}"

    - name: Add artifactory remote
      shell: bash
      run: |
        conan remote add --index 0 --force ripple http://18.143.149.228:8081/artifactory/api/conan/dev
