You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2026/03/16 13:13:19 UTC

(paimon-rust) branch main updated: ci: add release pipeline for go binding (#138)

This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 7d52915  ci: add release pipeline for go binding (#138)
7d52915 is described below

commit 7d52915b882ebc849b5c9b7e31bb34cbcbc2a710
Author: yuxia Luo <lu...@alumni.sjtu.edu.cn>
AuthorDate: Mon Mar 16 21:13:14 2026 +0800

    ci: add release pipeline for go binding (#138)
---
 .github/workflows/release-go-binding.yml | 187 +++++++++++++++++++++++++++++++
 bindings/go/RELEASE.md                   | 130 +++++++++++++++++++++
 2 files changed, 317 insertions(+)

diff --git a/.github/workflows/release-go-binding.yml b/.github/workflows/release-go-binding.yml
new file mode 100644
index 0000000..e3e8f76
--- /dev/null
+++ b/.github/workflows/release-go-binding.yml
@@ -0,0 +1,187 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Release Go Binding
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: Release version, for example v0.1.0 or v0.1.0-rc.1
+        required: true
+        type: string
+      source_ref:
+        description: Rust release baseline ref, for example main, v0.1.0-rc.1, or a commit SHA
+        required: true
+        type: string
+
+permissions:
+  contents: write
+
+jobs:
+  validate:
+    runs-on: ubuntu-latest
+    outputs:
+      tag: ${{ steps.meta.outputs.tag }}
+      source_sha: ${{ steps.meta.outputs.source_sha }}
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          ref: ${{ inputs.source_ref }}
+
+      - name: Validate release version and tag
+        id: meta
+        shell: bash
+        run: |
+          version='${{ inputs.version }}'
+          source_ref='${{ inputs.source_ref }}'
+          if [[ ! "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$ ]]; then
+            echo "invalid version: $version; expected vX.Y.Z or vX.Y.Z-rc.N" >&2
+            exit 1
+          fi
+          if [[ -z "$source_ref" ]]; then
+            echo "source_ref must not be empty" >&2
+            exit 1
+          fi
+
+          git rev-parse --verify "$source_ref^{commit}" >/dev/null 2>&1 || {
+            echo "source_ref does not resolve to a commit: $source_ref" >&2
+            exit 1
+          }
+
+          tag="bindings/go/$version"
+          if git rev-parse "$tag" >/dev/null 2>&1; then
+            echo "tag already exists: $tag" >&2
+            exit 1
+          fi
+
+          echo "tag=$tag" >> "$GITHUB_OUTPUT"
+          echo "source_sha=$(git rev-parse "$source_ref^{commit}")" >> "$GITHUB_OUTPUT"
+
+  build:
+    needs: validate
+    runs-on: ${{ matrix.runner }}
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - runner: ubuntu-latest
+            expected_file: libpaimon_c.linux.amd64.so.zst
+          - runner: ubuntu-24.04-arm
+            expected_file: libpaimon_c.linux.arm64.so.zst
+          - runner: macos-15-intel
+            expected_file: libpaimon_c.darwin.amd64.dylib.zst
+          - runner: macos-14
+            expected_file: libpaimon_c.darwin.arm64.dylib.zst
+
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: ${{ needs.validate.outputs.source_sha }}
+
+      - name: Install Rust toolchain
+        uses: dtolnay/rust-toolchain@stable
+
+      - name: Cache Rust build outputs
+        uses: Swatinem/rust-cache@v2
+
+      - name: Install zstd on Linux
+        if: runner.os == 'Linux'
+        run: sudo apt-get update && sudo apt-get install -y zstd
+
+      - name: Install zstd on macOS
+        if: runner.os == 'macOS'
+        run: brew install zstd
+
+      - name: Build embedded shared library
+        working-directory: bindings/go
+        run: make build
+
+      - name: Verify packaged library
+        working-directory: bindings/go
+        shell: bash
+        run: |
+          test -s '${{ matrix.expected_file }}'
+
+      - name: Upload packaged library
+        uses: actions/upload-artifact@v4
+        with:
+          name: ${{ matrix.expected_file }}
+          path: bindings/go/${{ matrix.expected_file }}
+          if-no-files-found: error
+
+  publish:
+    needs:
+      - validate
+      - build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          ref: ${{ needs.validate.outputs.source_sha }}
+
+      - name: Download packaged libraries
+        uses: actions/download-artifact@v4
+        with:
+          path: bindings/go
+          merge-multiple: true
+
+      - name: Verify embedded assets
+        working-directory: bindings/go
+        shell: bash
+        run: |
+          for file in \
+            libpaimon_c.linux.amd64.so.zst \
+            libpaimon_c.linux.arm64.so.zst \
+            libpaimon_c.darwin.amd64.dylib.zst \
+            libpaimon_c.darwin.arm64.dylib.zst
+          do
+            test -s "$file"
+          done
+
+      - name: Create release tag commit
+        env:
+          TAG: ${{ needs.validate.outputs.tag }}
+          VERSION: ${{ inputs.version }}
+          SOURCE_REF: ${{ inputs.source_ref }}
+          SOURCE_SHA: ${{ needs.validate.outputs.source_sha }}
+        shell: bash
+        run: |
+          git config user.name 'github-actions[bot]'
+          git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
+
+          git add bindings/go/libpaimon_c.*.zst
+
+          if ! git diff --cached --quiet; then
+            git commit -m "bindings/go: release ${VERSION} (from ${SOURCE_REF}@${SOURCE_SHA})"
+          fi
+
+          git tag -a "$TAG" -m "Release Go binding ${VERSION} from ${SOURCE_REF}@${SOURCE_SHA}"
+          git push origin "refs/tags/$TAG"
+
+      - name: Create GitHub release
+        uses: softprops/action-gh-release@v2
+        with:
+          tag_name: ${{ needs.validate.outputs.tag }}
+          generate_release_notes: true
+          files: |
+            bindings/go/libpaimon_c.linux.amd64.so.zst
+            bindings/go/libpaimon_c.linux.arm64.so.zst
+            bindings/go/libpaimon_c.darwin.amd64.dylib.zst
+            bindings/go/libpaimon_c.darwin.arm64.dylib.zst
diff --git a/bindings/go/RELEASE.md b/bindings/go/RELEASE.md
new file mode 100644
index 0000000..9fd547b
--- /dev/null
+++ b/bindings/go/RELEASE.md
@@ -0,0 +1,130 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+
+# Go Binding Release Checklist
+
+Use this checklist when publishing the Go module at:
+
+```text
+github.com/apache/paimon-rust/bindings/go
+```
+
+## Tagging Strategy
+
+- Choose a reviewed Rust release baseline commit first.
+- That baseline usually corresponds to the Rust source release tag or an approved
+  release-candidate commit.
+- Build the Go binding release artifacts from that baseline.
+- Because the Go module embeds generated shared-library archives,
+  `bindings/go/vX.Y.Z` does not need to point to the exact same commit as the
+  Rust release tag.
+- Instead, `bindings/go/vX.Y.Z` may point to a follow-up repository commit that
+  adds only Go release assets under `bindings/go/`.
+
+In practice, the release relationship should look like this:
+
+1. pick a Rust release baseline commit,
+2. create the Rust release tag from that baseline when appropriate,
+3. build the Go embedded libraries from the same baseline,
+4. create a Go release commit that contains the generated `libpaimon_c.*.zst`
+   files, and
+5. tag that commit as `bindings/go/vX.Y.Z` or `bindings/go/vX.Y.Z-rc.N`.
+
+This keeps a clear link to the Rust release baseline while allowing the Go
+submodule tag to contain the embedded artifacts required by Go module consumers.
+
+## Recommended Sequence
+
+- For an ASF-style release process, first complete the source release steps for
+  the Rust project.
+- After the corresponding release candidate has been approved, run the Go
+  binding release workflow to publish the convenience Go module tag.
+- If you publish release candidates for the Go binding, base them on the same
+  reviewed Rust release-candidate commit.
+
+## Before Release
+
+- Confirm the Go API changes are ready to publish.
+- Confirm the target version is decided, for example `v0.1.0`.
+- Confirm the Rust release baseline commit for this Go release is recorded.
+- Decide the exact `source_ref` to pass into the release workflow.
+- Confirm whether this Go release is based on a Rust GA tag or an approved Rust
+  release-candidate commit.
+- Use `vX.Y.Z-rc.N` for release candidates, for example `v0.1.0-rc.1`.
+- Use `vX.Y.Z` for the final general-availability release.
+- Confirm the version has not already been used as a Go submodule tag:
+  `bindings/go/v0.1.0`.
+- Confirm the Go binding still targets the correct module path in `bindings/go/go.mod`.
+- Confirm the embedded-library filenames expected by the Go package still match the Makefile output:
+  - `libpaimon_c.linux.amd64.so.zst`
+  - `libpaimon_c.linux.arm64.so.zst`
+  - `libpaimon_c.darwin.amd64.dylib.zst`
+  - `libpaimon_c.darwin.arm64.dylib.zst`
+- Confirm CI is green on `main` before publishing.
+
+## Publish
+
+- Open GitHub Actions and run `Release Go Binding`.
+- Provide the release version, for example `v0.1.0`.
+- Provide `source_ref`, for example `main`, `v0.1.0-rc.1`, or a specific commit SHA.
+- For release candidates, publish `bindings/go/vX.Y.Z-rc.N` first and verify it before the final tag.
+- Make sure the workflow is started from the intended Rust release baseline
+  branch or commit lineage.
+- Wait for all matrix builds to finish successfully:
+  - `linux/amd64`
+  - `linux/arm64`
+  - `darwin/amd64`
+  - `darwin/arm64`
+- Confirm the workflow creates the annotated tag `bindings/go/v0.1.0`.
+- Confirm the workflow publishes a GitHub release for that tag.
+
+## After Release
+
+- Confirm the release contains all four compressed shared-library assets.
+- Confirm the tag resolves to a commit that contains:
+  - `bindings/go/go.mod`
+  - `bindings/go/RELEASE.md`
+  - the four `libpaimon_c.*.zst` files
+- Record which Rust release tag or baseline commit this Go binding release was
+  built from.
+- Verify module resolution from a clean environment:
+
+```bash
+go list -m github.com/apache/paimon-rust/bindings/go@v0.1.0
+```
+
+- Verify install/import from a small test module:
+
+```bash
+go get github.com/apache/paimon-rust/bindings/go@v0.1.0
+```
+
+```go
+import paimon "github.com/apache/paimon-rust/bindings/go"
+```
+
+- If module proxy indexing is slow, retry after a few minutes and verify again.
+
+## Rollback Notes
+
+- Do not reuse a broken Go module version once it has been observed externally.
+- Do not delete and recreate an existing `bindings/go/vX.Y.Z-rc.N` or `bindings/go/vX.Y.Z` tag.
+- Publish a new patch version instead, for example move from `v0.1.0` to `v0.1.1`.
+- If an RC is bad, publish the next RC, for example move from `v0.1.0-rc.1` to `v0.1.0-rc.2`.
+- If the workflow fails before pushing the tag, fix the issue and rerun with the same intended version.