gemini-code-assist[bot] commented on code in PR #368: URL: https://github.com/apache/tvm-ffi/pull/368#discussion_r2649937396
########## docs/dev/release_process.rst: ########## @@ -0,0 +1,189 @@ +.. 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. + +Release Process +=============== + +This guide describes Apache TVM-FFI release workflow for creating a release +candidate, staging artifacts on ASF SVN, finalizing the release tag, and +publishing release artifacts. + +.. admonition:: Prerequisite + :class: hint + + The following environment variables need to be set before running the + release steps: + + .. code-block:: bash + + export FFI_VERSION="v0.1.7-rc0" + export FFI_RELEASE_VERSION="v0.1.7" + export SVN_DIR="$(pwd)/svn-tvm" + export ASF_USERNAME="your-apache-username" + + - Operator system: macOS; + - Tools: ``git``, ``svn``, ``gpg``, ``gtar``, and ``shasum``; + - A configured GPG key for signing artifacts. + + +Pre-release checklist (Step 0) +------------------------------ + +Before running the steps below, create the release candidate tag and open the +release vote. + +**Step 0.1.** Tag the pre-release: `<https://github.com/apache/tvm-ffi/releases/new>`__ + +**Step 0.2.** Open a voting thread: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__ (`Example <https://github.com/apache/tvm-ffi/issues/359>`__) + +Step 1. Create Release Candidate +-------------------------------- + +This builds and signs the source release artifacts under +``tvm-ffi-$FFI_VERSION/``. + +.. code-block:: bash + + _make_tarball() { Review Comment:  The shell scripts in this document would be more robust if they were configured to exit immediately upon any command failure. You can achieve this by adding `set -e` at the beginning of each script block (i.e., after each `.. code-block:: bash`). This prevents partially-executed scripts from causing an inconsistent state if a command fails. ```suggestion set -e _make_tarball() { ``` ########## docs/dev/release_process.rst: ########## @@ -0,0 +1,189 @@ +.. 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. + +Release Process +=============== + +This guide describes Apache TVM-FFI release workflow for creating a release +candidate, staging artifacts on ASF SVN, finalizing the release tag, and +publishing release artifacts. + +.. admonition:: Prerequisite + :class: hint + + The following environment variables need to be set before running the + release steps: + + .. code-block:: bash + + export FFI_VERSION="v0.1.7-rc0" + export FFI_RELEASE_VERSION="v0.1.7" + export SVN_DIR="$(pwd)/svn-tvm" + export ASF_USERNAME="your-apache-username" + + - Operator system: macOS; + - Tools: ``git``, ``svn``, ``gpg``, ``gtar``, and ``shasum``; + - A configured GPG key for signing artifacts. + + +Pre-release checklist (Step 0) +------------------------------ + +Before running the steps below, create the release candidate tag and open the +release vote. + +**Step 0.1.** Tag the pre-release: `<https://github.com/apache/tvm-ffi/releases/new>`__ + +**Step 0.2.** Open a voting thread: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__ (`Example <https://github.com/apache/tvm-ffi/issues/359>`__) + +Step 1. Create Release Candidate +-------------------------------- + +This builds and signs the source release artifacts under +``tvm-ffi-$FFI_VERSION/``. + +.. code-block:: bash + + _make_tarball() { + local _ver="$1" + local _workdir="tvm-ffi-$_ver-release-files" + local _release_dir="tvm-ffi-$_ver" + local _tarball="apache-tvm-ffi-$_ver.tar.gz" + + mkdir -p "$_workdir" "$_release_dir" + ( + cd "$_workdir" + + git clone --recursive https://github.com/apache/tvm-ffi.git ffi-release + cd ffi-release + + git checkout "$_ver" + rm -rf .DS_Store + find . -name ".git*" -print0 | xargs -0 rm -rf + + cd .. + gtar -czvf "$_tarball" -C ffi-release . + gpg --armor --output "$_tarball.asc" --detach-sig "$_tarball" + shasum -a 512 "$_tarball" > "$_tarball.sha512" + ) + mv "$_workdir/$_tarball" "$_release_dir/" + mv "$_workdir/$_tarball.asc" "$_release_dir/" + mv "$_workdir/$_tarball.sha512" "$_release_dir/" + rm -rf "$_workdir" + } + + _upload_to_apache_dev_svn() { + local _ver="$1" + local _svn_dir="$2" + local _asf_username="$3" + local _release_dir="tvm-ffi-$_ver" + ( + svn co --depth=files "https://dist.apache.org/repos/dist/dev/tvm" $_svn_dir + cp -r "${_release_dir}/" "$_svn_dir/$_release_dir" + cd "$_svn_dir" + svn add "$_release_dir" + svn ci --username "$_asf_username" -m "Add TVM-FFI $_ver" + ) + } + + _make_tarball "$FFI_VERSION" + _upload_to_apache_dev_svn "$FFI_VERSION" "$SVN_DIR" "$ASF_USERNAME" + + +Step 2. Conclude Release +------------------------ + +After the vote passes, retag the release, publish the wheel, bump versions, and +trigger the docs release. + +**Step 2.1.** Open the post-release issue: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__. (`Example <https://github.com/apache/tvm-ffi/issues/366>`__) + +**Step 2.2.** Publish PyPI wheel: `https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml <https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml>`__ + +**Step 2.3.** Publish latest documentation: `https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml <https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml>`__ + +**Step 2.4.** Re-tag the release candidate to the final release version, and bump the version in the source tree: + +.. code-block:: bash + + _retag_and_bump_version() { + local _ffi_version="$1" + local _ffi_release_version="$2" + + # Configuration variables + local _repo_url="[email protected]:apache/tvm-ffi.git" Review Comment:  The script hardcodes the repository URL to use the SSH protocol (`[email protected]:...`), which requires the user to have SSH keys configured with GitHub. Using the HTTPS URL is generally more accessible and doesn't require prior SSH setup. ```suggestion local _repo_url="https://github.com/apache/tvm-ffi.git" ``` ########## docs/dev/release_process.rst: ########## @@ -0,0 +1,189 @@ +.. 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. + +Release Process +=============== + +This guide describes Apache TVM-FFI release workflow for creating a release +candidate, staging artifacts on ASF SVN, finalizing the release tag, and +publishing release artifacts. + +.. admonition:: Prerequisite + :class: hint + + The following environment variables need to be set before running the + release steps: + + .. code-block:: bash + + export FFI_VERSION="v0.1.7-rc0" + export FFI_RELEASE_VERSION="v0.1.7" + export SVN_DIR="$(pwd)/svn-tvm" + export ASF_USERNAME="your-apache-username" + + - Operator system: macOS; + - Tools: ``git``, ``svn``, ``gpg``, ``gtar``, and ``shasum``; + - A configured GPG key for signing artifacts. + + +Pre-release checklist (Step 0) +------------------------------ + +Before running the steps below, create the release candidate tag and open the +release vote. + +**Step 0.1.** Tag the pre-release: `<https://github.com/apache/tvm-ffi/releases/new>`__ + +**Step 0.2.** Open a voting thread: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__ (`Example <https://github.com/apache/tvm-ffi/issues/359>`__) + +Step 1. Create Release Candidate +-------------------------------- + +This builds and signs the source release artifacts under +``tvm-ffi-$FFI_VERSION/``. + +.. code-block:: bash + + _make_tarball() { + local _ver="$1" + local _workdir="tvm-ffi-$_ver-release-files" + local _release_dir="tvm-ffi-$_ver" + local _tarball="apache-tvm-ffi-$_ver.tar.gz" + + mkdir -p "$_workdir" "$_release_dir" + ( + cd "$_workdir" + + git clone --recursive https://github.com/apache/tvm-ffi.git ffi-release + cd ffi-release + + git checkout "$_ver" + rm -rf .DS_Store + find . -name ".git*" -print0 | xargs -0 rm -rf + + cd .. + gtar -czvf "$_tarball" -C ffi-release . + gpg --armor --output "$_tarball.asc" --detach-sig "$_tarball" + shasum -a 512 "$_tarball" > "$_tarball.sha512" + ) + mv "$_workdir/$_tarball" "$_release_dir/" + mv "$_workdir/$_tarball.asc" "$_release_dir/" + mv "$_workdir/$_tarball.sha512" "$_release_dir/" + rm -rf "$_workdir" + } + + _upload_to_apache_dev_svn() { + local _ver="$1" + local _svn_dir="$2" + local _asf_username="$3" + local _release_dir="tvm-ffi-$_ver" + ( + svn co --depth=files "https://dist.apache.org/repos/dist/dev/tvm" $_svn_dir + cp -r "${_release_dir}/" "$_svn_dir/$_release_dir" + cd "$_svn_dir" + svn add "$_release_dir" + svn ci --username "$_asf_username" -m "Add TVM-FFI $_ver" + ) + } + + _make_tarball "$FFI_VERSION" + _upload_to_apache_dev_svn "$FFI_VERSION" "$SVN_DIR" "$ASF_USERNAME" + + +Step 2. Conclude Release +------------------------ + +After the vote passes, retag the release, publish the wheel, bump versions, and +trigger the docs release. + +**Step 2.1.** Open the post-release issue: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__. (`Example <https://github.com/apache/tvm-ffi/issues/366>`__) + +**Step 2.2.** Publish PyPI wheel: `https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml <https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml>`__ + +**Step 2.3.** Publish latest documentation: `https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml <https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml>`__ + +**Step 2.4.** Re-tag the release candidate to the final release version, and bump the version in the source tree: + +.. code-block:: bash + + _retag_and_bump_version() { + local _ffi_version="$1" + local _ffi_release_version="$2" + + # Configuration variables + local _repo_url="[email protected]:apache/tvm-ffi.git" + local _work_dir="tvm-ffi-release" + local _git_remote="upstream" + local _header_file="include/tvm/ffi/c_api.h" + + # 1. Git clone with remote named "upstream" + echo "Cloning repository..." + git clone -o "$_git_remote" "$_repo_url" "$_work_dir" + cd "$_work_dir" || return 1 + git fetch "$_git_remote" --tags + + # 2. Replace tag and push + local _ffi_commit="$(git rev-parse "${_ffi_version}^{commit}")" + echo "Creating release tag $_ffi_release_version at commit $_ffi_commit..." + git tag -a "$_ffi_release_version" "$_ffi_commit" -m "Release $_ffi_release_version" + git push "$_git_remote" "$_ffi_release_version" + git push "$_git_remote" --delete "$_ffi_version" + + # 3. Version bump after the release + local _today=$(date +%Y-%m-%d) + local _branch_name="${_today}/ver-bump" + local _current_patch=$(grep "#define TVM_FFI_VERSION_PATCH" "$_header_file" | awk '{print $3}') Review Comment:  Using `grep ... | awk '{print $3}'` to extract the patch version is a bit fragile and could break if the spacing in the header file changes. A more robust approach would be to use a tool like `sed` with a more specific regular expression to extract just the version number. ```suggestion local _current_patch=$(sed -n 's/^#define TVM_FFI_VERSION_PATCH[ \t]\+\([0-9]\+\).*/\1/p' "$_header_file") ``` ########## docs/dev/release_process.rst: ########## @@ -0,0 +1,189 @@ +.. 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. + +Release Process +=============== + +This guide describes Apache TVM-FFI release workflow for creating a release +candidate, staging artifacts on ASF SVN, finalizing the release tag, and +publishing release artifacts. + +.. admonition:: Prerequisite + :class: hint + + The following environment variables need to be set before running the + release steps: + + .. code-block:: bash + + export FFI_VERSION="v0.1.7-rc0" + export FFI_RELEASE_VERSION="v0.1.7" + export SVN_DIR="$(pwd)/svn-tvm" + export ASF_USERNAME="your-apache-username" + + - Operator system: macOS; + - Tools: ``git``, ``svn``, ``gpg``, ``gtar``, and ``shasum``; Review Comment:  The documentation specifies `gtar` and `shasum` as required tools, which implies a dependency on macOS. For better portability, especially for Linux users, it would be helpful to either mention the Linux equivalents (e.g., `tar` for `gtar`, and `sha512sum` for `shasum -a 512`) or modify the scripts to be more cross-platform. For example, you could detect the available command: ```bash if command -v shasum &> /dev/null; then shasum -a 512 "$_tarball" > "$_tarball.sha512" else sha512sum "$_tarball" > "$_tarball.sha512" fi ``` ########## docs/dev/release_process.rst: ########## @@ -0,0 +1,189 @@ +.. 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. + +Release Process +=============== + +This guide describes Apache TVM-FFI release workflow for creating a release +candidate, staging artifacts on ASF SVN, finalizing the release tag, and +publishing release artifacts. + +.. admonition:: Prerequisite + :class: hint + + The following environment variables need to be set before running the + release steps: + + .. code-block:: bash + + export FFI_VERSION="v0.1.7-rc0" + export FFI_RELEASE_VERSION="v0.1.7" + export SVN_DIR="$(pwd)/svn-tvm" + export ASF_USERNAME="your-apache-username" + + - Operator system: macOS; + - Tools: ``git``, ``svn``, ``gpg``, ``gtar``, and ``shasum``; + - A configured GPG key for signing artifacts. + + +Pre-release checklist (Step 0) +------------------------------ + +Before running the steps below, create the release candidate tag and open the +release vote. + +**Step 0.1.** Tag the pre-release: `<https://github.com/apache/tvm-ffi/releases/new>`__ + +**Step 0.2.** Open a voting thread: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__ (`Example <https://github.com/apache/tvm-ffi/issues/359>`__) + +Step 1. Create Release Candidate +-------------------------------- + +This builds and signs the source release artifacts under +``tvm-ffi-$FFI_VERSION/``. + +.. code-block:: bash + + _make_tarball() { + local _ver="$1" + local _workdir="tvm-ffi-$_ver-release-files" + local _release_dir="tvm-ffi-$_ver" + local _tarball="apache-tvm-ffi-$_ver.tar.gz" + + mkdir -p "$_workdir" "$_release_dir" + ( + cd "$_workdir" + + git clone --recursive https://github.com/apache/tvm-ffi.git ffi-release + cd ffi-release + + git checkout "$_ver" + rm -rf .DS_Store + find . -name ".git*" -print0 | xargs -0 rm -rf + + cd .. + gtar -czvf "$_tarball" -C ffi-release . + gpg --armor --output "$_tarball.asc" --detach-sig "$_tarball" + shasum -a 512 "$_tarball" > "$_tarball.sha512" + ) + mv "$_workdir/$_tarball" "$_release_dir/" + mv "$_workdir/$_tarball.asc" "$_release_dir/" + mv "$_workdir/$_tarball.sha512" "$_release_dir/" + rm -rf "$_workdir" + } + + _upload_to_apache_dev_svn() { + local _ver="$1" + local _svn_dir="$2" + local _asf_username="$3" + local _release_dir="tvm-ffi-$_ver" + ( + svn co --depth=files "https://dist.apache.org/repos/dist/dev/tvm" $_svn_dir + cp -r "${_release_dir}/" "$_svn_dir/$_release_dir" + cd "$_svn_dir" + svn add "$_release_dir" + svn ci --username "$_asf_username" -m "Add TVM-FFI $_ver" + ) + } + + _make_tarball "$FFI_VERSION" + _upload_to_apache_dev_svn "$FFI_VERSION" "$SVN_DIR" "$ASF_USERNAME" + + +Step 2. Conclude Release +------------------------ + +After the vote passes, retag the release, publish the wheel, bump versions, and +trigger the docs release. + +**Step 2.1.** Open the post-release issue: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__. (`Example <https://github.com/apache/tvm-ffi/issues/366>`__) + +**Step 2.2.** Publish PyPI wheel: `https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml <https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml>`__ + +**Step 2.3.** Publish latest documentation: `https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml <https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml>`__ + +**Step 2.4.** Re-tag the release candidate to the final release version, and bump the version in the source tree: + +.. code-block:: bash + + _retag_and_bump_version() { + local _ffi_version="$1" + local _ffi_release_version="$2" + + # Configuration variables + local _repo_url="[email protected]:apache/tvm-ffi.git" + local _work_dir="tvm-ffi-release" + local _git_remote="upstream" + local _header_file="include/tvm/ffi/c_api.h" + + # 1. Git clone with remote named "upstream" + echo "Cloning repository..." + git clone -o "$_git_remote" "$_repo_url" "$_work_dir" + cd "$_work_dir" || return 1 + git fetch "$_git_remote" --tags + + # 2. Replace tag and push + local _ffi_commit="$(git rev-parse "${_ffi_version}^{commit}")" + echo "Creating release tag $_ffi_release_version at commit $_ffi_commit..." + git tag -a "$_ffi_release_version" "$_ffi_commit" -m "Release $_ffi_release_version" + git push "$_git_remote" "$_ffi_release_version" + git push "$_git_remote" --delete "$_ffi_version" + + # 3. Version bump after the release + local _today=$(date +%Y-%m-%d) + local _branch_name="${_today}/ver-bump" + local _current_patch=$(grep "#define TVM_FFI_VERSION_PATCH" "$_header_file" | awk '{print $3}') + local _new_patch=$((_current_patch + 1)) + git checkout -b "$_branch_name" + echo "Bumping TVM_FFI_VERSION_PATCH from $_current_patch to $_new_patch" + sed "s/#define TVM_FFI_VERSION_PATCH $_current_patch/#define TVM_FFI_VERSION_PATCH $_new_patch/" "$_header_file" > "${_header_file}.tmp" && mv "${_header_file}.tmp" "$_header_file" + echo "Committing and pushing changes..." + git add "$_header_file" + git commit -m "chore(release): Version bump after release $_ffi_release_version" + git push -u "$_git_remote" "$_branch_name" + } + + _retag_and_bump_version "$FFI_VERSION" "$FFI_RELEASE_VERSION" + + +Step 3. Upload Release Artifacts +-------------------------------- + +After the release is final, copy the RC artifacts into ``dist/release`` with the +final version name. + +.. code-block:: bash + + _upload_svn() { + local _ffi_version="$1" + local _ffi_release_version="$2" + local _asf_username="$3" + local _release_dir="tvm-ffi-$_ffi_version" + local _svn_dir="$(pwd)/svn-tvm-release" Review Comment:  In Step 1, the SVN directory for development artifacts is configured via the `SVN_DIR` environment variable. However, in Step 3, the SVN directory for release artifacts is hardcoded within the `_upload_svn` function. This is inconsistent and could be confusing. Consider using another environment variable (e.g., `SVN_RELEASE_DIR`) for this path and documenting it in the prerequisites to make the scripts more consistent and configurable. ########## docs/dev/release_process.rst: ########## @@ -0,0 +1,189 @@ +.. 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. + +Release Process +=============== + +This guide describes Apache TVM-FFI release workflow for creating a release +candidate, staging artifacts on ASF SVN, finalizing the release tag, and +publishing release artifacts. + +.. admonition:: Prerequisite + :class: hint + + The following environment variables need to be set before running the + release steps: + + .. code-block:: bash + + export FFI_VERSION="v0.1.7-rc0" + export FFI_RELEASE_VERSION="v0.1.7" + export SVN_DIR="$(pwd)/svn-tvm" + export ASF_USERNAME="your-apache-username" + + - Operator system: macOS; + - Tools: ``git``, ``svn``, ``gpg``, ``gtar``, and ``shasum``; + - A configured GPG key for signing artifacts. + + +Pre-release checklist (Step 0) +------------------------------ + +Before running the steps below, create the release candidate tag and open the +release vote. + +**Step 0.1.** Tag the pre-release: `<https://github.com/apache/tvm-ffi/releases/new>`__ + +**Step 0.2.** Open a voting thread: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__ (`Example <https://github.com/apache/tvm-ffi/issues/359>`__) + +Step 1. Create Release Candidate +-------------------------------- + +This builds and signs the source release artifacts under +``tvm-ffi-$FFI_VERSION/``. + +.. code-block:: bash + + _make_tarball() { + local _ver="$1" + local _workdir="tvm-ffi-$_ver-release-files" + local _release_dir="tvm-ffi-$_ver" + local _tarball="apache-tvm-ffi-$_ver.tar.gz" + + mkdir -p "$_workdir" "$_release_dir" + ( + cd "$_workdir" + + git clone --recursive https://github.com/apache/tvm-ffi.git ffi-release + cd ffi-release + + git checkout "$_ver" + rm -rf .DS_Store + find . -name ".git*" -print0 | xargs -0 rm -rf + + cd .. + gtar -czvf "$_tarball" -C ffi-release . + gpg --armor --output "$_tarball.asc" --detach-sig "$_tarball" + shasum -a 512 "$_tarball" > "$_tarball.sha512" + ) + mv "$_workdir/$_tarball" "$_release_dir/" + mv "$_workdir/$_tarball.asc" "$_release_dir/" + mv "$_workdir/$_tarball.sha512" "$_release_dir/" + rm -rf "$_workdir" + } + + _upload_to_apache_dev_svn() { + local _ver="$1" + local _svn_dir="$2" + local _asf_username="$3" + local _release_dir="tvm-ffi-$_ver" + ( + svn co --depth=files "https://dist.apache.org/repos/dist/dev/tvm" $_svn_dir + cp -r "${_release_dir}/" "$_svn_dir/$_release_dir" + cd "$_svn_dir" + svn add "$_release_dir" + svn ci --username "$_asf_username" -m "Add TVM-FFI $_ver" + ) + } + + _make_tarball "$FFI_VERSION" + _upload_to_apache_dev_svn "$FFI_VERSION" "$SVN_DIR" "$ASF_USERNAME" + + +Step 2. Conclude Release +------------------------ + +After the vote passes, retag the release, publish the wheel, bump versions, and +trigger the docs release. + +**Step 2.1.** Open the post-release issue: `https://github.com/apache/tvm-ffi/issues/new <https://github.com/apache/tvm-ffi/issues/new>`__. (`Example <https://github.com/apache/tvm-ffi/issues/366>`__) + +**Step 2.2.** Publish PyPI wheel: `https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml <https://github.com/apache/tvm-ffi/actions/workflows/publish_wheel.yml>`__ + +**Step 2.3.** Publish latest documentation: `https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml <https://github.com/apache/tvm-site/actions/workflows/publish_tvm_ffi_docs.yml>`__ + +**Step 2.4.** Re-tag the release candidate to the final release version, and bump the version in the source tree: + +.. code-block:: bash + + _retag_and_bump_version() { + local _ffi_version="$1" + local _ffi_release_version="$2" + + # Configuration variables + local _repo_url="[email protected]:apache/tvm-ffi.git" + local _work_dir="tvm-ffi-release" + local _git_remote="upstream" + local _header_file="include/tvm/ffi/c_api.h" + + # 1. Git clone with remote named "upstream" + echo "Cloning repository..." + git clone -o "$_git_remote" "$_repo_url" "$_work_dir" + cd "$_work_dir" || return 1 + git fetch "$_git_remote" --tags + + # 2. Replace tag and push + local _ffi_commit="$(git rev-parse "${_ffi_version}^{commit}")" + echo "Creating release tag $_ffi_release_version at commit $_ffi_commit..." + git tag -a "$_ffi_release_version" "$_ffi_commit" -m "Release $_ffi_release_version" + git push "$_git_remote" "$_ffi_release_version" + git push "$_git_remote" --delete "$_ffi_version" + + # 3. Version bump after the release + local _today=$(date +%Y-%m-%d) + local _branch_name="${_today}/ver-bump" + local _current_patch=$(grep "#define TVM_FFI_VERSION_PATCH" "$_header_file" | awk '{print $3}') + local _new_patch=$((_current_patch + 1)) + git checkout -b "$_branch_name" + echo "Bumping TVM_FFI_VERSION_PATCH from $_current_patch to $_new_patch" + sed "s/#define TVM_FFI_VERSION_PATCH $_current_patch/#define TVM_FFI_VERSION_PATCH $_new_patch/" "$_header_file" > "${_header_file}.tmp" && mv "${_header_file}.tmp" "$_header_file" + echo "Committing and pushing changes..." + git add "$_header_file" + git commit -m "chore(release): Version bump after release $_ffi_release_version" + git push -u "$_git_remote" "$_branch_name" Review Comment:  After pushing the version bump branch, the next step is likely to open a pull request with these changes. It would be helpful to explicitly mention this in the documentation to make the process clearer for the release manager. For example, you could add: "After pushing the branch, open a pull request on GitHub for the version bump." -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
