Upload to JFrog #48
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 | |
# 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 | |
user_channel: | |
description: 'define the user and channel for the package ' | |
default: '' | |
type: choice | |
options: | |
- '' | |
- 'milvus/dev' | |
- 'milvus/2.4' | |
- 'milvus/2.3' | |
jobs: | |
Build: | |
name: Build for ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 180 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Ubuntu 22.04 | |
os: ubuntu22.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 }}@${{ github.event.inputs.user_channel }} --build=missing | |
else | |
conan create . ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@${{ github.event.inputs.user_channel }} --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 }}-20240625-2ecfe15 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 }}-20240625-2ecfe15 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 }}-20240625-2ecfe15 conan upload ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@${{ github.event.inputs.user_channel }} -r default-conan-local --all | |
- name: print-package-revision | |
run: | | |
docker run -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/root/.conan:delegated milvusdb/milvus-env:${{ matrix.os }}-20240625-2ecfe15 conan search ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@${{ github.event.inputs.user_channel }} --revisions |