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

zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 9bfcd572 chore: Automate GitHub Releases creation and site redirect 
(#497)
9bfcd572 is described below

commit 9bfcd57244a6e23c2f5eaff58ed71b7dbe2a4506
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Sep 10 07:09:18 2025 +0900

    chore: Automate GitHub Releases creation and site redirect (#497)
    
    ### Rationale for this change
    
    Fixes #496
    
    We should automate release process as much as possible to reduce
    maintenance cost.
    
    ### What changes are included in this PR?
    
    * Add a workflow that is used on release tag such as `v18.4.1`
    * It creates a GitHub Release for the release automatically
      * Asserts are copied from the GitHub Released of the passed RC
      * It also creates a discussion for the release
    * It updates the asf-site branch
    
    ### Are these changes tested?
    
    No...
    
    ### Are there any user-facing changes?
    
    Yes.
---
 .github/workflows/rc.yml      |   2 +-
 .github/workflows/release.yml | 101 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml
index 1c47f22e..1f33c16e 100644
--- a/.github/workflows/rc.yml
+++ b/.github/workflows/rc.yml
@@ -22,7 +22,7 @@ on:
       - '**'
       - '!dependabot/**'
     tags:
-      - '*-rc*'
+      - 'v*-rc*'
   pull_request:
 concurrency:
   group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ 
github.workflow }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..0f261e6a
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,101 @@
+# 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
+on:
+  push:
+    tags:
+      - "v*"
+      - "!v*-rc*"
+permissions:
+  contents: write
+env:
+  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+jobs:
+  publish:
+    name: Publish
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
+    steps:
+      - name: Download RC contents
+        run: |
+          latest_rc_tag=$(gh release list \
+                            --jq '.[].tagName' \
+                            --json tagName \
+                            --repo ${GITHUB_REPOSITORY} | \
+                              grep -F "${GITHUB_REF_NAME}-rc" | \
+                              head -n1)
+          gh release download ${latest_rc_tag} \
+            --repo ${GITHUB_REPOSITORY} \
+            --dir dists
+      - name: Create GitHub Release
+        run: |
+          version=${GITHUB_REF_NAME#v}
+          gh release create ${GITHUB_REF_NAME} \
+            --discussion-category Announcements \
+            --generate-notes \
+            --repo ${GITHUB_REPOSITORY} \
+            --title "Apache Arrow Go ${version}" \
+            --verify-tag \
+            dists/*
+      - name: Checkout asf-site
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 
v5.0.0
+        with:
+          ref: asf-site
+          path: site
+      - name: Update documentation
+        run: |
+          # v18.4.1 -> 18.4.1
+          version=${GITHUB_REF_NAME#v}
+          # 18.4.1 -> 18
+          major_version=${version%%.*}
+          # 18.4.1 -> 4.1
+          minor_patch_version=${version#*.}
+
+          cd site
+          cp ../.asf.yaml ./
+          if [ "${minor_patch_version}" = "0.0" ]; then
+            # Major release
+            cat <<HTACCESS > .htaccess
+          # 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.
+
+          Redirect permanent /go/ 
https://pkg.go.dev/github.com/apache/arrow-go/v${major_version}/
+          HTACCESS
+          fi
+          git add .
+
+          if [ "$(git diff --cached)" != "" ]; then
+            git config user.name "github-actions[bot]"
+            git config user.email 
"github-actions[bot]@users.noreply.github.com"
+            git commit -m "Update docs for ${version}"
+            git push origin "$(git branch --show-current)"
+          fi

Reply via email to