Skip to content

update build ref

update build ref #234

Workflow file for this run

name: build
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
# allow run workflow manually from a commit
# might useful to test pull request in OpenMLDB which changes third-party files
workflow_dispatch:
inputs:
OPENMLDB_REPO:
description: OpenMLDB repo url going to fetch, can be a fork
required: true
default: 4paradigm/OpenMLDB
type: string
OPENMLDB_REF:
description: specific commit/tag SHA
required: true
type: string
UPLOAD:
description: upload the built artifact for testing
default: false
type: boolean
env:
OPENMLDB_REPO: 4paradigm/OpenMLDB
OPENMLDB_REF: 28c3ac7ee6664d1d0b5ce7f756bb3c9a30c70769
jobs:
thirdparty-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- container: ghcr.io/4paradigm/hybridsql-base:latest
flags: ""
distro: centos
- container: ubuntu:20.04
flags: -DBUILD_ZOOKEEPER_PATCH=ON
distro: ubuntu
container:
image: ${{ matrix.container }}
env:
MAKEOPTS: -j2
DISTRO: ${{ matrix.distro }}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v3
- name: setup deps
if: startsWith(matrix.container, 'ubuntu')
run: |
apt update
DEBIAN_FRONTEND=noninteractive apt-get install -y bison python3-dev libcppunit-dev build-essential cmake autoconf tcl pkg-config git curl patch libtool-bin
- name: download thirdparty source
uses: actions/checkout@v3
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
repository: ${{ env.OPENMLDB_REPO }}
ref: ${{ env.OPENMLDB_REF }}
path: openmldb
- name: download thirdparty source (workflow_dispatch)
uses: actions/checkout@v3
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.OPENMLDB_REPO }}
ref: ${{ github.event.inputs.OPENMLDB_REF }}
path: openmldb
- name: configure
run: |
cmake -S openmldb/third-party -B deps -DBUILD_BUNDLED=ON -DWITH_ZETASQL=OFF -DCMAKE_BUILD_TYPE=Release ${{ env.flags }}
- name: build
run: |
cmake --build deps
- name: create archive
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=${VERSION#v}
./pack_all.sh -i deps -n "$VERSION"
- name: Upload Artifact
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
uses: actions/upload-artifact@v3
with:
path: deps/thirdparty-*.tar.gz
thirdparty-darwin:
runs-on: macos-12
env:
MAKEOPTS: -j3
steps:
- uses: actions/checkout@v4
# xcode 14.0.1 comes with macOS SDK 12.3, ref https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#installed-sdks
# so pre-compile zetasql requires macOS >= 12.3
- name: Xcode Select Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.0.1'
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: "3.20.x"
- name: download thirdparty source
uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
repository: ${{ env.OPENMLDB_REPO }}
ref: ${{ env.OPENMLDB_REF }}
path: openmldb
- name: download thirdparty source (workflow_dispatch)
uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.OPENMLDB_REPO }}
ref: ${{ github.event.inputs.OPENMLDB_REF }}
path: openmldb
- name: Install System Dependencies
# coreutils for nproc
# gnu-getopt for brpc
run: |
brew install automake coreutils gnu-getopt
- name: configure
run: |
cmake -S openmldb/third-party -B deps -DBUILD_BUNDLED=ON -DWITH_ZETASQL=OFF -DCMAKE_BUILD_TYPE=Release ${{ env.flags }}
- name: build
run: |
cmake --build deps
- name: verbose minos info
run: |
otool -l deps/usr/lib/libabsl_base.a | grep -A 20 LC_BUILD_VERSION
- name: create archive
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=${VERSION#v}
./pack_all.sh -i deps -n "$VERSION"
- name: Upload Artifact
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.UPLOAD == true)
uses: actions/upload-artifact@v3
with:
path: deps/thirdparty-*.tar.gz
release:
runs-on: ubuntu-latest
needs: ["thirdparty-linux", "thirdparty-darwin"]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: generate signature
working-directory: artifact
run: |
sha256sum third*.tar.gz > SHA256SUM
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
artifact/thirdparty*.tar.gz
artifact/SHA256SUM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}