Skip to content

Commit

Permalink
Merge pull request #3393 from spidernet-io/robot/cherrypick/pr3377/re…
Browse files Browse the repository at this point in the history
…lease-v0.9

CI:  update release version in readme
  • Loading branch information
ty-dc authored Apr 22, 2024
2 parents dd812cf + 5e929f9 commit 056cb85
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 28 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/auto-version-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ jobs:
dest_tag: ${{ needs.get-tag.outputs.tag }}
secrets: inherit

update-release-version:
needs: [build-release-image, get-tag]
uses: ./.github/workflows/call-release-version.yaml
with:
dest_tag: ${{ needs.get-tag.outputs.tag }}
secrets: inherit

create-release:
needs: [release-chart, release-changelog, get-tag]
name: create release
Expand Down
127 changes: 127 additions & 0 deletions .github/workflows/call-release-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Update The Release Version Of README

on:
workflow_call:
inputs:
ref:
required: true
type: string
# --- call by manual
workflow_dispatch:
inputs:
ref:
description: 'branch, tag, sha, example: v0.9.2'
required: true
default: v0.9.2

permissions: write-all

env:
PR_LABEL: pr/release/doc
PR_REVIWER: ty-dc

jobs:
release_notes:
runs-on: ubuntu-latest
outputs:
ref: ${{ env.REF }}
steps:
- name: Get Ref
id: get_ref
run: |
pwd
ls
if ${{ github.event_name == 'workflow_dispatch' }}; then
echo "call by workflow_dispatch"
echo "REF=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
elif ${{ inputs.ref != '' }}; then
echo "call by workflow_call"
echo "REF=${{ inputs.ref }}" >> $GITHUB_ENV
else
echo "unexpected event: ${{ github.event_name }}"
exit 1
fi
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
# update the release-note of the main branch after the release.
ref: main

# As versions are released, the versions we maintain will change.
# Since we only maintain the latest versions of the three branches,
# for minor version(.z version) changes, we will update the release version accordingly.
# For major version(.y version) releases, we add a new release version and delete the oldest version.
- name: update release version of readme
run: |
echo "update release version of readme"
branchName=` grep -Eo "v[0-9]+\.[0-9]+" <<< ${{ env.REF }} `
if [ -n "${branchName}" ]; then
echo "the branch obtained from the version number is: ${branchName}"
else
echo "error, failed to get ${branchName}, are you sure the version is correct: ${{ env.REF }} ?." && exit 1
fi
FILE_NAME_LIST=$(grep -Rl '\[Release Notes\]' --exclude-dir .github)
echo "FILE_NAME_LIST: ${FILE_NAME_LIST}"
if ! grep -r '\[Release Notes\]' * | grep release-${branchName} ; then
echo "release notes for this version: release-${branchName} do not exist"
for FILE_NAME in ${FILE_NAME_LIST}
do
BEGIN_LINE=$(grep '\[Release Notes\]' $FILE_NAME -n | awk -F ':' '{print $1}' | head -n 1)
END_LINE=$(grep '\[Release Notes\]' $FILE_NAME -n | awk -F ':' '{print $1}' | tail -n 1)
MINIMAL_VERSION=$(sed -n -e "${END_LINE}p" $FILE_NAME | awk -F 'release-|]' '{print $2}')
if [[ "${branchName}" < "${MINIMAL_VERSION}" ]]; then
echo "${branchName} is not a maintenance release and the version information in the readme file will not be updated."
echo "SKIP=true" >> $GITHUB_ENV
exit 0
fi
echo "delete file:$FILE_NAME line $END_LINE"
sed -i -e "${END_LINE} d" $FILE_NAME
echo "succeeded to delete file:$FILE_NAME the $END_LINE"
echo "Add file:$FILE_NAME line before $BEGIN_LINE"
ASSERT_LINE=$((BEGIN_LINE-1))
lineText="| [release-$branchName](https://github.com/spidernet-io/spiderpool/tree/release-${branchName}) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/${{ env.REF }}) |"
sed -i -e "${ASSERT_LINE}a $lineText" $FILE_NAME
echo "succeeded to add file:$FILE_NAME the $ASSERT_LINE"
done
else
for FILE_NAME in ${FILE_NAME_LIST}
do
grep '\[Release Notes\]' $FILE_NAME -n | grep release-${branchName}
LINE=$(grep '\[Release Notes\]' $FILE_NAME -n | grep release-${branchName} | awk -F ':' '{print $1}'| head -n 1)
echo "delete file:$FILE_NAME line $LINE"
sed -i -e "${LINE}d" $FILE_NAME
echo "succeeded to delete file:$FILE_NAME the $LINE"
echo "Add file:$FILE_NAME line before $LINE"
ASSERT_LINE=$(($LINE-1))
lineText="| [release-$branchName](https://github.com/spidernet-io/spiderpool/tree/release-${branchName}) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/${{ env.REF }}) |"
sed -i -e "${ASSERT_LINE}a $lineText" $FILE_NAME
echo "succeeded to add file:$FILE_NAME the $ASSERT_LINE"
done
fi
- uses: crazy-max/ghaction-import-gpg@v6
if: ${{ env.SKIP != 'true' }}
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

# Allow auto-merge on general
- name: Create Pull Request
if: ${{ env.SKIP != 'true' }}
id: create_pr
uses: peter-evans/[email protected]
with:
title: "robot updates the release version of the README file based on the release tag: ${{ env.REF }} "
commit-message: "robot updates the release version of the README file based on the release tag: ${{ env.REF }}"
branch-suffix: timestamp
committer: ty-dc <[email protected]>
branch: robot/update_doc
delete-branch: true
signoff: true
token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.PR_LABEL }}
reviewers: ${{ env.PR_REVIWER }}
14 changes: 0 additions & 14 deletions docs/README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ Spiderpool 是一个 kubernetes 的 underlay 和 RDMA 网络解决方案,它
[ipvlan CNI](https://github.com/containernetworking/plugins/tree/main/plugins/main/ipvlan)
[SR-IOV CNI](https://github.com/k8snetworkplumbingwg/sriov-cni) 的功能,满足了各种网络需求,使得 underlay 网络方案可应用在**裸金属、虚拟机和公有云环境**中,可为网络 I/O 密集性、低延时应用带来优秀的网络性能,包括**存储、中间件、AI 等应用**。详细的文档可参考[文档站](https://spidernet-io.github.io/spiderpool/)

## 稳定版本

Spiderpool 社区将最新的三个 Spiderpool 补丁版本视为稳定版本,并定期维护。之前较旧的 Spiderpool 补丁版本将被视为 EOL(过时版本)。

如需升级到新的补丁版本,请参阅 [Spiderpool 升级指南](./usage/install/upgrade-zh_CN.md)

下面列出的是当前维护的发布分支及其最新发布的补丁的发布说明:

| 发布分支 | 发行说明 |
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [release-v0.9](https://github.com/spidernet-io/spiderpool/tree/release-v0.9) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/v0.9.1) |
| [release-v0.8](https://github.com/spidernet-io/spiderpool/tree/release-v0.8) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/v0.8.5) |
| [release-v0.7](https://github.com/spidernet-io/spiderpool/tree/release-v0.7) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/v0.7.3) |

## Underlay CNI 的优势

underlay CNI 主要指 macvlan、ipvlan、SR-IOV 等能够直接访问宿主机二层网络的 CNI 技术,它有如下优势:
Expand Down
14 changes: 0 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ Spiderpool is an underlay and RDMA network solution for the Kubernetes. It enhan
[SR-IOV CNI](https://github.com/k8snetworkplumbingwg/sriov-cni), fulfills various networking needs, and supports to run on **bare metal, virtual machine, and public cloud environments**. Spiderpool delivers exceptional network performance, particularly benefiting network I/O-intensive and low-latency applications like **storage, middleware, and AI**.
It could refer to [website](https://spidernet-io.github.io/spiderpool/) for more details.

## Stable Releases

The Spiderpool community maintains minor stable releases for the last three minor Spiderpool versions. Older Spiderpool stable versions from minor releases prior to that are considered EOL.

For upgrades to new minor releases please consult the [Spiderpool Upgrade Guide](./usage/install/upgrade.md).

Listed below are the release notes for the currently maintained release branches and their latest released patches:

| release branches | Release Notes |
| -------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [release-v0.9](https://github.com/spidernet-io/spiderpool/tree/release-v0.9) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/v0.9.1) |
| [release-v0.8](https://github.com/spidernet-io/spiderpool/tree/release-v0.8) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/v0.8.5) |
| [release-v0.7](https://github.com/spidernet-io/spiderpool/tree/release-v0.7) | [Release Notes](https://github.com/spidernet-io/spiderpool/releases/tag/v0.7.3) |

## The Advantages Of Underlay CNI

The underlay CNI is mainly including macvlan, ipvlan, and SR-IOV, which cloud access the layer 2 network of the node. It has some advantages:
Expand Down

0 comments on commit 056cb85

Please sign in to comment.