Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: support build on no tag #3641

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/other-os-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ on:
description: 'The branch, tag or SHA to checkout, otherwise use the branch'
required: false
default: ''
ZETASQL_LIB_URL:
description: 'zetasql lib url, default is built by src, if you want to use prebuilt, set it. Only for centos6'
required: false
default: ''

env:
NPROC: 2 # default Parallel build number for GitHub's Linux runner
Expand All @@ -35,6 +39,7 @@ jobs:
OS: linux
SQL_JAVASDK_ENABLE: ${{ github.event.inputs.JAVA_SDK }}
SQL_PYSDK_ENABLE: ${{ github.event.inputs.PYTHON_SDK }} # python whl will be built when make, no prerequirement
ZETASQL_LIB_URL: ${{ github.event.inputs.ZETASQL_LIB_URL }}
TESTING_ENABLE: OFF
NPROC: 8
steps:
Expand All @@ -46,7 +51,8 @@ jobs:
- name: prepare release
run: |
VERSION="snapshot"
TAG=$(git tag -l | grep $(git describe HEAD))
# if not tag, return error, just ignore it to use snapshot as the version
TAG=$(git tag -l | grep $(git describe HEAD)) || true
if [[ "${TAG}" == "v"* ]]; then
VERSION=${TAG#v}
bash steps/prepare_release.sh "$VERSION"
Expand Down Expand Up @@ -74,7 +80,7 @@ jobs:
- uses: addnab/docker-run-action@v3
with:
image: ghcr.io/4paradigm/centos6_gcc7_hybridsql
options: -v ${{ github.workspace }}:/root/OpenMLDB -e USE_DEPS_CACHE=${{ steps.deps-cache.outputs.cache-hit }} -e OPENMLDB_PREFIX=${{ env.OPENMLDB_PREFIX }} -e SQL_PYSDK_ENABLE=${{ env.SQL_PYSDK_ENABLE }} -e SQL_JAVASDK_ENABLE=${{ env.SQL_JAVASDK_ENABLE }}
options: -v ${{ github.workspace }}:/root/OpenMLDB -e USE_DEPS_CACHE=${{ steps.deps-cache.outputs.cache-hit }} -e OPENMLDB_PREFIX=${{ env.OPENMLDB_PREFIX }} -e SQL_PYSDK_ENABLE=${{ env.SQL_PYSDK_ENABLE }} -e SQL_JAVASDK_ENABLE=${{ env.SQL_JAVASDK_ENABLE }} -e ZETASQL_LIB_URL=${{ env.ZETASQL_LIB_URL }}
shell: bash
run: |
cd /root/OpenMLDB
Expand All @@ -89,6 +95,10 @@ jobs:
# 5.8G ./.deps, avail 8G
rm -rf .deps/build # GitHub runner disk space is limited
fi
if [[ "${ZETASQL_LIB_URL}" != "" ]]; then
echo "replace zetasql lib by ${ZETASQL_LIB_URL}"
curl -SLo .deps/usr/lib/libzetasql.a ${ZETASQL_LIB_URL}
fi
echo "build"
# 1.4G ./.deps, avail 13G

Expand Down Expand Up @@ -172,7 +182,7 @@ jobs:
run: |
VERSION="snapshot"
# use repo ref not event ref
TAG=$(git tag -l | grep $(git describe HEAD))
TAG=$(git tag -l | grep $(git describe HEAD)) || true
if [[ "${TAG}" == "v"* ]]; then
VERSION=${TAG#v}
bash steps/prepare_release.sh "$VERSION"
Expand Down Expand Up @@ -242,7 +252,7 @@ jobs:
- name: prepare release
run: |
VERSION="snapshot"
TAG=$(git tag -l | grep $(git describe HEAD))
TAG=$(git tag -l | grep $(git describe HEAD)) || true
if [[ "${TAG}" == "v"* ]]; then
VERSION=${TAG#v}
bash steps/prepare_release.sh "$VERSION"
Expand Down
15 changes: 8 additions & 7 deletions steps/centos6_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,22 @@ function tool_install() {
chmod +x bazel
}

if [ "$USE_DEPS_CACHE" == "true" ]; then
echo "use deps cache, exit"
exit 0
else
echo "not use deps cache, install tools and build deps"
fi

if [ "$IN_WORKFLOW" == "true" ]; then
echo "in workflow"
else
echo "in self build"
fi

echo "always install tools"
tool_install

if [ "$USE_DEPS_CACHE" == "true" ]; then
echo "use deps cache, exit"
exit 0
else
echo "no deps cache, build deps"
fi

echo "set envs, if IN_WORKFLOW, you should set envs in workflow"
new_path=$PATH:$(pwd)
export PATH=$new_path
Expand Down