diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e976b87..fd6791f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,9 @@ defaults: run: shell: bash +env: + VERSION: 5.1 + jobs: build_and_upload: runs-on: @@ -56,7 +59,7 @@ jobs: steps: - uses: webiny/action-post-run@3.0.0 with: - run: sh -c "find . -mindepth 1 -delete" + run: find . -mindepth 1 -delete - uses: actions/checkout@v3 - name: Set up environment if: matrix.compiler != '' @@ -64,17 +67,14 @@ jobs: export URL=https://raw.githubusercontent.com/vesoft-inc/nebula-gears/master/install bash <(curl -Ls $URL) install-gcc --version=${{ matrix.compiler }} - echo "COMPILER_VERSION=${{ matrix.compiler }}" >> $GITHUB_ENV - name: Pre-Build run: | - echo "path=$(pwd)" >> $GITHUB_ENV - cd .. if [ -d "build" ]; then find build -maxdepth 1 -mindepth 1 ! -name '*.tgz' -exec rm -rf {} + else mkdir build fi - sync + working-directory: ../ - name: Build run: | if [[ -n "${{ matrix.compiler }}" ]]; then @@ -84,7 +84,7 @@ jobs: export PATH=${TOOLSET_GCC_DIR}/bin:${PATH} export LD_LIBRARY_PATH=${TOOLSET_GCC_DIR}/lib64:$LD_LIBRARY_PATH fi - build_package=1 ${{ env.path }}/build.sh + build_package=1 version=$VERSION ./build.sh working-directory: ../build/ - name: Setup MinIO uses: vesoft-inc/.github/actions/setup-minio@master @@ -93,7 +93,15 @@ jobs: access_key: ${{ secrets.MINIO_KEY }} secret_key: ${{ secrets.MINIO_SECRET }} - name: Copy dir to MinIO - run: mc cp -r ../build/packages/ minio/rc-build/third-party/5.0/ + run: mc cp -r ../build/packages/ minio/rc-build/third-party/$VERSION/ + - uses: vesoft-inc/.github/actions/upload-to-oss@master + with: + key-id: ${{ secrets.OSS_ID }} + key-secret: ${{ secrets.OSS_SECRET }} + endpoint: ${{ secrets.OSS_ENDPOINT }} + bucket: nebula-graph + asset-path: ../build/packages/ + target-path: third-party/$VERSION/ repo-dispatch: needs: build_and_upload @@ -104,3 +112,7 @@ jobs: token: ${{ secrets.GH_PAT }} repository: vesoft-inc/nebula-dev-docker event-type: nebula-third-party-build + client-payload: |- + { + "version": "${{ env.VERSION }}" + } diff --git a/build.sh b/build.sh index 170fa02..b4858b4 100755 --- a/build.sh +++ b/build.sh @@ -66,7 +66,7 @@ function check_cxx { check_cxx # Directories setup -version=5.1 +[[ -z $version ]] && version=5.1 cur_dir=`pwd` source_dir=$this_dir/project build_root=$cur_dir diff --git a/install-third-party.sh b/install-third-party.sh index f479745..f0af9c2 100755 --- a/install-third-party.sh +++ b/install-third-party.sh @@ -20,7 +20,7 @@ then fi [[ -z $version ]] && version=5.1 -url_base=https://oss-cdn.nebula-graph.com.cn/third-party/$version +[[ -z $url_base ]] && url_base=https://oss-cdn.nebula-graph.com.cn/third-party this_dir=$(dirname $(readlink -f $0)) cxx_cmd=${CXX:-g++} @@ -92,7 +92,7 @@ selected_gcc_version=$(select_by_version $this_gcc_version "${gcc_preset_version selected_archive=vesoft-third-party-$version-$(uname -m)-libc-$selected_libc_version-gcc-$selected_gcc_version-abi-$this_abi_version.sh -url=$url_base/$selected_archive +url=$url_base/$version/$selected_archive echo "Downloading $selected_archive..." $download_cmd $url [[ $? -ne 0 ]] && {