Skip to content

Github action update #24

Github action update

Github action update #24

name: Upload Conan packages
env:
CONAN_LOGIN_USERNAME_OSP: ${{ secrets.osp_artifactory_usr }}
CONAN_PASSWORD_OSP: ${{ secrets.osp_artifactory_pwd }}
CONAN_REVISIONS_ENABLED: 1
CONAN_NON_INTERACTIVE: True
on: [push, workflow_dispatch]
jobs:
linux:
name: Linux
runs-on: ${{matrix.os}}
env:
CC: gcc-${{ matrix.compiler_version }}
CXX: g++-${{ matrix.compiler_version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler_version: [9]
compiler_libcxx: [libstdc++11]
steps:
- uses: actions/checkout@v4
- name: Install compiler
run: sudo apt-get install -y --no-install-recommends g++-${{ matrix.compiler_version }}
- name: Create a conan dir
run: mkdir -p ~/.conan2
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-packages
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-${{ hashFiles('**/conan.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.build_type }}-
${{ runner.os }}-
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Configure Conan
run: |
conan profile detect -f
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Conan create
run: |
REFNAME="${GITHUB_REF#refs/*/}"
VERSION="v$(<version.txt)"
if [[ $GITHUB_REF == refs/tags/* ]] && [[ $REFNAME == $VERSION ]]; then CHANNEL="stable"
elif [[ $REFNAME == master ]]; then CHANNEL="testing"
else
SHORT_REFNAME="${REFNAME:0:40}"
CHANNEL="testing-${SHORT_REFNAME//\//_}"
fi
conan create -s build_type=${{ matrix.build_type }} -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.compiler_libcxx }} -b missing . --user=osp --channel=${CHANNEL}
- name: Conan upload
run: conan upload --confirm --remote osp 'proxyfmu*'
windows:
name: Windows
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Create a conan dir
run: mkdir -p ~/.conan2
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-packages
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-${{ hashFiles('**/conan.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.build_type }}-
${{ runner.os }}-
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Configure Conan
run: |
conan profile detect -f
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Conan create
shell: bash
run: |
REFNAME="${GITHUB_REF#refs/*/}"
VERSION="v$(<version.txt)"
if [[ $GITHUB_REF == refs/tags/* ]] && [[ $REFNAME == $VERSION ]]; then CHANNEL="stable"
elif [[ $REFNAME == master ]]; then CHANNEL="testing"
else
SHORT_REFNAME="${REFNAME:0:40}"
CHANNEL="testing-${SHORT_REFNAME//\//_}"
fi
conan create -s build_type=${{ matrix.build_type }} -b missing . --user=osp --channel=${CHANNEL}
- name: Conan upload
run: conan upload --confirm --remote osp 'proxyfmu*'