Skip to content

Commit

Permalink
Merge pull request #32 from aceforeverd/ci/ubuntu-job
Browse files Browse the repository at this point in the history
ci: add ubuntu job
  • Loading branch information
jingchen2222 committed Dec 16, 2021
2 parents 8dde6d0 + 70d3cc8 commit e83addd
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
53 changes: 49 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
linux-build:
centos-build:
runs-on: ubuntu-latest
container:
image: ghcr.io/aceforeverd/hybridsql-base:0.4.0
Expand Down Expand Up @@ -54,9 +54,55 @@ jobs:
echo "TAG=$VERSION" >> $GITHUB_ENV
- name: pack libzetasql
run: |
./pack_zetasql.sh -d centos
env:
TAG: ${{ env.TAG }}

- name: Upload Artifacts
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v2
with:
path: libzetasql-*.tar.gz
name: release-artifacts

ubuntu-build:
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
steps:
- name: setup dependencies
run: |
./pack_zetasql.sh
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y -q curl build-essential unzip python3-dev git
update-alternatives --install /usr/bin/python python /usr/bin/python3 100
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'adopt' # See 'Supported distributions' for available options
java-version: '8'

- name: Setup Bazel
run: |
curl --create-dirs -SLo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64
chmod +x /usr/local/bin/bazel
- name: build zetasql parser
run: |
./build_zetasql_parser.sh
- name: Determine Version
if: ${{ github.event_name == 'push' }}
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=$(echo $VERSION | sed -e 's/^v//')
echo "TAG=$VERSION" >> $GITHUB_ENV
- name: pack libzetasql
run: |
./pack_zetasql.sh -d ubuntu
env:
TAG: ${{ env.TAG }}

Expand Down Expand Up @@ -100,7 +146,6 @@ jobs:
echo "TAG=$VERSION" >> $GITHUB_ENV
- name: pack libzetasql
if: ${{ github.event_name == 'push' }}
run: |
./pack_zetasql.sh
env:
Expand All @@ -115,7 +160,7 @@ jobs:

release:
runs-on: ubuntu-latest
needs: ["linux-build", "macos-build"]
needs: ["centos-build", "ubuntu-build", "macos-build"]
if: startsWith(github.ref, 'refs/tags/v')
timeout-minutes: 120
steps:
Expand Down
10 changes: 8 additions & 2 deletions pack_zetasql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function usage ()
Options:
-h Display this message
-d Linux distribution name, e.g centos, ubuntu
-i Request install to given directory after pack"

} # ---------- end of function usage ----------
Expand All @@ -23,12 +24,17 @@ function usage ()
#-----------------------------------------------------------------------

INSTALL_DIR=
while getopts ":hi:" opt
# linux distribution name
DISTRO=

while getopts ":hi:d:" opt
do
case $opt in

h ) usage; exit 0 ;;

d ) DISTRO=$OPTARG ;;

i )
INSTALL_DIR=$OPTARG
mkdir -p "$INSTALL_DIR"
Expand Down Expand Up @@ -167,7 +173,7 @@ fi
if [[ $OSTYPE = 'darwin'* ]]; then
OUT_FILE="${ZETASQL_LIB_NAME}-darwin-$(uname -m).tar.gz"
else
OUT_FILE="${ZETASQL_LIB_NAME}-$OSTYPE-$(uname -m).tar.gz"
OUT_FILE="${ZETASQL_LIB_NAME}-$OSTYPE-$(uname -m)-$DISTRO.tar.gz"
fi
tar czf "$OUT_FILE" "$ZETASQL_LIB_NAME"/

Expand Down

0 comments on commit e83addd

Please sign in to comment.