diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..0810992 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,58 @@ +name: Release packages + +# This workflow is triggered on pushes or pull request to the repository. +on: + push: + tags: + - v* + +jobs: + linux: + name: Release package for ${{ matrix.os.distro }} ${{ matrix.os.version }} + runs-on: ubuntu-latest + container: ${{ matrix.os.image }} + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + os: + - distro: Ubuntu + version: 18.04 + image: ubuntu:18.04 + key: u1804 + - distro: Ubuntu + version: 20.04 + image: ubuntu:20.04 + key: u2004 + - distro: CentOS + version: 7 + image: centos:7 + key: c7 + - distro: Fedora + version: 34 + image: fedora:34 + key: fc34 + - distro: Fedora + version: 35 + image: fedora:35 + key: fc35 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Prepare + run: | + sh scripts/install_deps.sh + - name: Build + run: | + export MILVUS_SDK_VERSION="$(echo ${{ github.event.ref }} | sed s@refs/tags/v@@)" + make test + make clean + make package + # remove package with `Linux` from thridpart + rm -fr cmake_build/src/Pack/*Linux* + - name: Release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: cmake_build/src/Pack/libmilvus-* + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/build.sh b/scripts/build.sh index b36d44e..32aa108 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -24,17 +24,21 @@ BUILD_TEST="OFF" MAKE_CLEAN="OFF" RUN_CPPLINT="OFF" BUILD_PACKAGE="OFF" +MILVUS_SDK_VERSION=${MILVUS_SDK_VERSION:-2.0.0} JOBS="$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 8)" if [ ${JOBS} -lt 8 ] ; then JOBS=8 fi -while getopts "t:ulrsph" arg; do +while getopts "t:v:ulrsph" arg; do case $arg in t) BUILD_TYPE=$OPTARG # BUILD_TYPE ;; + v) + MILVUS_SDK_VERSION=$OPTARG + ;; l) RUN_CPPLINT="ON" BUILD_TEST="ON" # lint requires build with ut @@ -72,7 +76,7 @@ parameter: -h: help usage: -./build.sh -t \${BUILD_TYPE} [-l] [-r] [-h] +./build.sh -t \${BUILD_TYPE} -v \${MILVUS_SDK_VERSION} [-l] [-r] [-h] " exit 0 ;; @@ -97,6 +101,7 @@ CMAKE_CMD="cmake \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DBUILD_TEST=${BUILD_TEST} \ -DMAKE_BUILD_ARGS=${JOBS} +-DMILVUS_SDK_VERSION=${MILVUS_SDK_VERSION} \ ../" echo ${CMAKE_CMD} ${CMAKE_CMD}