Skip to content

Commit

Permalink
Add release pipeline on tag push
Browse files Browse the repository at this point in the history
- using tag with vx.y.z will trigger a release pipeline

Signed-off-by: Ji Bin <[email protected]>
  • Loading branch information
matrixji committed Feb 24, 2022
1 parent 08480e1 commit a2ad972
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
9 changes: 7 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
;;
Expand All @@ -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}
Expand Down

0 comments on commit a2ad972

Please sign in to comment.