Skip to content

Commit

Permalink
feat: pack zetasql and upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jingchen2222 committed May 20, 2021
1 parent a61b460 commit 4886c2a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 54 deletions.
68 changes: 15 additions & 53 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,28 @@ jobs:
- name: Test
run: |
bazel test ${{ env.build_argv }} --test_summary=detailed ${{ env.target }}
- 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
if: ${{ github.event_name == 'push' }}
run: |
./pack_zetasql.sh
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

macos-build:
runs-on: macos-latest
timeout-minutes: 120
Expand Down Expand Up @@ -111,12 +122,14 @@ jobs:
bazel test ${{ env.build_argv }} --test_summary=detailed ${{ env.target }}
- 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
if: ${{ github.event_name == 'push' }}
run: |
./pack_zetasql.sh
env:
Expand Down Expand Up @@ -179,60 +192,9 @@ jobs:
source /opt/rh/rh-python38/enable
bazel test ${{ env.build_argv }} --test_summary=detailed --test_output=errors ${{ env.target }}
linux-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
container:
image: ghcr.io/aceforeverd/hybridsql-base:0.0.8
env:
BAZEL_LINKOPTS: '-static-libstdc++:-lm'
BAZEL_LINKLIBS: '-l%:libstdc++.a'
target: '//zetasql/...'
build_argv: ''
steps:
- uses: actions/checkout@v2
- name: Setup Bazel
run: |
curl --create-dirs -SLo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.8.0/bazelisk-linux-amd64
chmod +x /usr/local/bin/bazel
- name: Install Java
run: |
yum install -y java-1.8.0-openjdk-devel
- name: build zetasql
run: |
source /opt/rh/devtoolset-8/enable
source /opt/rh/rh-python38/enable
bazel build ${{ env.build_argv }} ${{ env.target }}
- name: Find Orphan Library
run: |
./find_orphan_so.sh
- name: Determine Version
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
env:
TAG: ${{ env.TAG }}

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
libzetasql-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

mac-release:
release:
runs-on: macos-latest
needs: ["macos-build"]
needs: ["linux-build", "macos-build"]
if: startsWith(github.ref, 'refs/tags/v')
timeout-minutes: 120
steps:
Expand Down
2 changes: 1 addition & 1 deletion pack_zetasql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ else
mv libzetasql.a "$PREFIX/lib"
fi
echo "ls zetasqllib"
ls "${ZETASQL_LIB_NAME}"/
ls "${PREFIX}/lib"
if [[ "$OSTYPE" == "linux-gnu"* ]]
then
tar czf "${ZETASQL_LIB_NAME}-linux-x86_64.tar.gz" "${ZETASQL_LIB_NAME}"/
Expand Down

0 comments on commit 4886c2a

Please sign in to comment.