Upload to JFrog for milvus 2.3.x #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload to JFrog for milvus 2.3.x | |
# This workflow is triggered on pushes or pull request to the repository. | |
on: | |
workflow_dispatch: | |
inputs: | |
package: | |
description: 'Packaget to build' | |
required: true | |
version: | |
description: 'Version to build' | |
required: true | |
jobs: | |
Build: | |
name: Build for ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 180 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: ubuntu20.04 | |
os: ubuntu20.04 | |
- name: Amazonlinux 2023 | |
os: amazonlinux2023 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache Conan Packages | |
uses: pat-s/always-upload-cache@v3 | |
with: | |
path: .docker/conan-cache/data | |
key: conan-${{ matrix.os }}-${{ hashFiles('conanfile.*') }} | |
- name: Prepare | |
run: | | |
mkdir -p .docker/conan-cache | |
echo "VERSION=$(git describe --tags --always --dirty="-dev" | cut -c 2-)" >> $GITHUB_ENV | |
- name: Build | |
run: | | |
cat << EOF > build.sh | |
#!/usr/bin/env bash | |
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local | |
cd ${{ github.event.inputs.package }}/all | |
if [[ `gcc -v 2>&1 | sed -n 's/.*\(--with-default-libstdcxx-abi\)=\(\w*\).*/\2/p'` == "gcc4" ]]; then | |
conan create . ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@ --build=missing | |
else | |
conan create . ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@ --build=missing -s compiler.libcxx=libstdc++11 | |
fi | |
EOF | |
chmod +x build.sh | |
docker run -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/root/.conan:delegated -v $(pwd):/work:delegated -w /work milvusdb/milvus-env:${{ matrix.os }}-20230913-8e142ff bash -c /work/build.sh | |
- name: Upload | |
run: | | |
docker run -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/root/.conan:delegated milvusdb/milvus-env:${{ matrix.os }}-20230913-8e142ff conan user -p ${{ secrets.JFROG_PASSWORD }} -r default-conan-local ${{ secrets.JFROG_USERNAME }} | |
docker run -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/root/.conan:delegated milvusdb/milvus-env:${{ matrix.os }}-20230913-8e142ff conan upload ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@ -r default-conan-local --all |