From d00ae3b31132dd6699be31c9c2f5a991bc82cf4c Mon Sep 17 00:00:00 2001 From: auxten Date: Sat, 23 Dec 2023 16:29:16 +0800 Subject: [PATCH] Fix pipeline --- .github/workflows/chdb.yml | 20 +++++++++++++++++- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++---- Makefile | 2 -- 3 files changed, 55 insertions(+), 7 deletions(-) diff --git a/.github/workflows/chdb.yml b/.github/workflows/chdb.yml index cf5f5c0..7087ad8 100644 --- a/.github/workflows/chdb.yml +++ b/.github/workflows/chdb.yml @@ -7,10 +7,28 @@ on: - '**/.md' jobs: - build: + build_linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Fetch library + run: | + make install + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.21" + - name: Build + run: | + go mod tidy + make build + - name: Test + run: LD_LIBRARY_PATH=./ ./chdb-go "SELECT 12345" + + build_mac: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 - name: Fetch library run: | make install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a61fa47..210a2c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,7 @@ on: types: [created] jobs: - - build: + build_linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -22,7 +21,7 @@ jobs: go mod tidy make build - name: Test - run: ./chdb-go "SELECT 12345" + run: LD_LIBRARY_PATH=. ./chdb-go "SELECT 12345" - name: Get Version run: | echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV @@ -38,4 +37,37 @@ jobs: release_name: chdbgo_${{ env.VERSION }} draft: false prerelease: false - overwrite: true + overwrite: true + build_mac: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - name: Fetch library + run: | + make install + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.21" + - name: Build + run: | + go mod tidy + make build + - name: Test + run: ./chdb-go "SELECT 12345" + - name: Get Version + run: | + echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV + - name: Upload release + if: github.event_name != 'pull_request' + uses: boxpositron/upload-multiple-releases@1.0.7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_config: | + chdb-go-macos + tag_name: ${{ env.VERSION }} + release_name: chdbgo_${{ env.VERSION }} + draft: false + prerelease: false + overwrite: true diff --git a/Makefile b/Makefile index 1a770a4..e47e2bd 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,6 @@ install: update_libchdb sudo cp -a libchdb.so /usr/local/lib # if on Linux run `sudo ldconfig` to update the cache # if on macOS run `sudo update_dyld_shared_cache` to update the cache - if [ "$$OSTYPE" == "linux-gnu" ]; then sudo ldconfig; fi - test: CGO_ENABLED=1 go test -v -coverprofile=coverage.out ./...