From 8992d4c275a49a6c142feb34aa941212dc345df4 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 15 Apr 2024 00:18:10 +0800 Subject: [PATCH] [WIP] mocks --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1681e42 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: release + +on: + push: + tags: + - 'v*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + release: + name: ${{ matrix.job.name }} + runs-on: ${{ matrix.job.os }} + strategy: + matrix: + job: + - {os: "macos-12", goos: "darwin", goarch: "amd64", name: "x86_64-apple-darwin", suffix: "dylib"} + - {os: "macos-14", goos: "darwin", goarch: "arm64", name: "aarch64-apple-darwin", suffix: "dylib"} + - {os: "ubuntu-latest", goos: "linux", goarch: "amd64", name: "x86_64-linux-gnu", suffix: "so"} + - {os: "windows-latest", goos: "windows", goarch: "amd64", name: "x86_64-windows-msvc", suffix: "dll"} + fail-fast: false + env: + CGO_ENABLED: "1" + # set GO_VERSION according to + # https://github.com/cocoa-xu/arrow-adbc/blob/feat-mocks/.env + GO_VERSION: "1.21.8" + steps: + - name: fetch feat-mocks branch + run: | + git clone --branch feat-mocks --depth 1 https://github.com/cocoa-xu/arrow-adbc.git + + - uses: actions/setup-go@v5 + with: + go-version: "${{ env.GO_VERSION }}" + check-latest: true + cache: true + cache-dependency-path: arrow-adbc/go/adbc/go.sum + + - name: Go Build + shell: bash -l {0} + run: | + export PATH=$RUNNER_TOOL_CACHE/go/${GO_VERSION}/${{ matrix.job.goarch }}/bin:$PATH + export GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.goarch }} + cd arrow-adbc/go/adbc/pkg + go run gen/main.go -prefix Mocks -o ./mocks/ -driver ../driver/mocks + make "libadbc_driver_mocks.${{ matrix.job.suffix }}" + mv "libadbc_driver_mocks.${{ matrix.job.suffix }}" "../../../../libadbc_driver_mocks-${{ matrix.job.name }}.${{ matrix.job.suffix }}" + + - uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + libadbc_driver_mocks-${{ matrix.job.name }}.${{ matrix.job.suffix }}