Skip to content

Commit

Permalink
Read the oss url base from environment variable (#140)
Browse files Browse the repository at this point in the history
* Read the oss url base from environment variable

* Fix version folder

* Fix url_base

* Version env

* Upload to oss
  • Loading branch information
yixinglu authored Mar 4, 2024
1 parent 34ce6af commit 02e453f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ defaults:
run:
shell: bash

env:
VERSION: 5.1

jobs:
build_and_upload:
runs-on:
Expand Down Expand Up @@ -56,25 +59,22 @@ jobs:
steps:
- uses: webiny/[email protected]
with:
run: sh -c "find . -mindepth 1 -delete"
run: find . -mindepth 1 -delete
- uses: actions/checkout@v3
- name: Set up environment
if: matrix.compiler != ''
run: |
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}"
}
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions install-third-party.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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++}

Expand Down Expand Up @@ -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 ]] && {
Expand Down

0 comments on commit 02e453f

Please sign in to comment.