Improve release doc and script (#13147)
This commit is contained in:
parent
27c37d3bf8
commit
ba639e39bf
|
|
@ -69,6 +69,7 @@ header:
|
|||
- 'oap-server/server-starter/src/main/resources/version.properties'
|
||||
- '**/mockito-extensions/**'
|
||||
- 'oap-server/server-library/library-async-profiler-jfr-parser'
|
||||
- 'docs/en/changes/changes.tpl'
|
||||
|
||||
comment: on-failure
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
## NEXT_RELEASE_VERSION
|
||||
|
||||
#### Project
|
||||
|
||||
#### OAP Server
|
||||
|
||||
#### UI
|
||||
|
||||
#### Documentation
|
||||
|
||||
|
||||
All issues and pull requests are [here](https://github.com/apache/skywalking/issues?q=milestone:NEXT_RELEASE_VERSION)
|
||||
|
||||
|
|
@ -8,90 +8,36 @@ Add your GPG public key into the [SkyWalking GPG KEYS](https://dist.apache.org/r
|
|||
- If you are a PMC member, use your Apache ID and password to log in this svn, and update the file. **Don't override the existing file.**
|
||||
- If you are a committer, please ask a PMC member to help you.
|
||||
|
||||
## Tag for the release
|
||||
## Create artifacts for the release
|
||||
|
||||
- Set the version number that you are about to release.
|
||||
- Create a new empty folder to do the release work.
|
||||
- Set the version numbers and run the release script file [`tools/releasing/create_release_tars.sh`](https://github.com/apache/skywalking/blob/master/tools/releasing/create_release_tars.sh)
|
||||
|
||||
```bash
|
||||
export RELEASE_VERSION=x.y.z # (example: RELEASE_VERSION=10.1.0)
|
||||
export NEXT_RELEASE_VERSION=x.y.z # (example: NEXT_RELEASE_VERSION=10.2.0)
|
||||
export PRODUCT_NAME="apache-skywalking-apm"
|
||||
export SOURCE_FILE="dist/${PRODUCT_NAME}-${RELEASE_VERSION}.tar.gz"
|
||||
export TARGET_DIR="tools/releasing"
|
||||
curl -Ls https://raw.githubusercontent.com/apache/skywalking/refs/heads/master/tools/releasing/create_release_tars.sh | bash -
|
||||
```
|
||||
|
||||
- Create a new folder for the new release.
|
||||
After all the steps are completed, you will have the following files in the folder:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/apache/skywalking.git
|
||||
cd skywalking
|
||||
git checkout -b ${RELEASE_VERSION}-release # Create a branch for new release, such as 10.1.0-release
|
||||
git submodule init
|
||||
git submodule update
|
||||
```text
|
||||
apache-skywalking-apm-${RELEASE_VERSION}-bin.tar.gz
|
||||
apache-skywalking-apm-${RELEASE_VERSION}-bin.tar.gz.asc
|
||||
apache-skywalking-apm-${RELEASE_VERSION}-bin.tar.gz.sha512
|
||||
apache-skywalking-apm-${RELEASE_VERSION}-src.tar.gz
|
||||
apache-skywalking-apm-${RELEASE_VERSION}-src.tar.gz.asc
|
||||
apache-skywalking-apm-${RELEASE_VERSION}-src.tar.gz.sha512
|
||||
```
|
||||
|
||||
- Update the property `revision` in `pom.xml` file, and commit it.
|
||||
|
||||
```bash
|
||||
./mvnw versions:set-property -DgenerateBackupPoms=false -Dproperty=revision -DnewVersion=${RELEASE_VERSION}
|
||||
git add pom.xml
|
||||
git commit -m "Prepare for release ${RELEASE_VERSION}"
|
||||
```
|
||||
|
||||
- Tag the commit and push it to the upstream.
|
||||
|
||||
```bash
|
||||
git tag v${RELEASE_VERSION}
|
||||
git push origin v${RELEASE_VERSION}
|
||||
```
|
||||
|
||||
## Build the binary package
|
||||
|
||||
```bash
|
||||
./mvnw install package -DskipTests
|
||||
mv "$SOURCE_FILE" "$TARGET_DIR/"
|
||||
```
|
||||
|
||||
The release will be packaged first as `apache-skywalking-apm-x.y.z.tar.gz` in the `{PROJECT_ROOT}/dist` directory, and
|
||||
then moved to the `tools/releasing` directory.
|
||||
|
||||
|
||||
## Build the source code package, sign the source code package and binary package
|
||||
```bash
|
||||
cd tools/releasing
|
||||
bash create_release_tars.sh
|
||||
```
|
||||
|
||||
This script takes care of the following things:
|
||||
1. Use `v` + `RELEASE_VERSION` as tag to clone the codes.
|
||||
1. Complete `git submodule init/update`.
|
||||
1. Exclude all unnecessary files in the target source tar, such as `.git`, `.github`, and `.gitmodules`. See the script for more details.
|
||||
1. Execute `gpg` and `shasum 512` for source tar and binary tar.
|
||||
|
||||
`apache-skywalking-apm-x.y.z-src.tgz` and files ending with `.asc` and `.sha512` may be found in the `tools/releasing` folder.
|
||||
|
||||
## Start the next iteration
|
||||
|
||||
Once the binary and source packages are created, you can start updating the version to the next number and open a pull request.
|
||||
|
||||
```bash
|
||||
# Update the version to the next snapshot version still in the same branch, such as 10.1.0-release
|
||||
./mvnw versions:set-property -DgenerateBackupPoms=false -Dproperty=revision -DnewVersion=${NEXT_RELEASE_VERSION}-SNAPSHOT
|
||||
git add pom.xml
|
||||
git commit -m "Start next iteration ${NEXT_RELEASE_VERSION}"
|
||||
curl -Ls https://raw.githubusercontent.com/apache/skywalking/refs/heads/master/tools/releasing/start_next_version.sh | bash -
|
||||
```
|
||||
|
||||
Update the change log files for the next iteration.
|
||||
* Rename [latest changes](../changes/changes.md) to `changes-{RELEASE_VERSION}.md`.
|
||||
* Reset the [latest changes](../changes/changes.md) to the new version.
|
||||
* Update Changelog in the `menu.yml` to link to `changes-{RELEASE_VERSION}.md`.
|
||||
|
||||
```bash
|
||||
git push
|
||||
gh pr create --fill # If you have gh cli installed and configured, or open the pull request in https://github.com/apache/skywalking/pulls
|
||||
```
|
||||
|
||||
|
||||
## Upload to Apache svn
|
||||
1. Use your Apache ID to log in to `https://dist.apache.org/repos/dist/dev/skywalking/`.
|
||||
1. Create a folder and name it by the release version and round, such as: `x.y.z`
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ catalog:
|
|||
- name: "Progressive TTL"
|
||||
path: "/en/banyandb/ttl"
|
||||
- name: "Data Lifecycle Stages(Hot/Warm/Cold)"
|
||||
path: "/en/banyandb/lifecycle-stages"
|
||||
path: "/en/banyandb/stages"
|
||||
- name: "Tracing"
|
||||
catalog:
|
||||
- name: "Trace Sampling"
|
||||
|
|
|
|||
|
|
@ -20,62 +20,71 @@
|
|||
# This script relies on few environment variables to determine source code package
|
||||
# behavior, those variables are:
|
||||
# RELEASE_VERSION -- The version of this source package.
|
||||
# For example: RELEASE_VERSION=10.0.0
|
||||
# NEXT_RELEASE_VERSION -- The version of the next release.
|
||||
# For example: RELEASE_VERSION=10.0.0, NEXT_RELEASE_VERSION=10.0.1
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
RELEASE_VERSION=${RELEASE_VERSION}
|
||||
TAG_NAME=v${RELEASE_VERSION}
|
||||
PRODUCT_NAME="apache-skywalking-apm"
|
||||
|
||||
echo "Release version "${RELEASE_VERSION}
|
||||
echo "Source tag "${TAG_NAME}
|
||||
|
||||
if [ "$RELEASE_VERSION" == "" ]; then
|
||||
echo "RELEASE_VERSION environment variable not found, Please setting the RELEASE_VERSION."
|
||||
if [ "$RELEASE_VERSION" == "" ] || [ "$NEXT_RELEASE_VERSION" == "" ]; then
|
||||
echo "RELEASE_VERSION or NEXT_RELEASE_VERSION environment variable not found."
|
||||
echo "Please set the RELEASE_VERSION and NEXT_RELEASE_VERSION."
|
||||
echo "For example: export RELEASE_VERSION=10.0.0"
|
||||
echo " : export NEXT_RELEASE_VERSION=10.0.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Creating source package"
|
||||
PRODUCT_NAME="apache-skywalking-apm"
|
||||
TAG=v${RELEASE_VERSION}
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
MVN=${MVN:-./mvnw}
|
||||
|
||||
PRODUCT_NAME=${PRODUCT_NAME}-${RELEASE_VERSION}
|
||||
|
||||
rm -rf ${PRODUCT_NAME}
|
||||
mkdir ${PRODUCT_NAME}
|
||||
|
||||
git clone https://github.com/apache/skywalking.git ./${PRODUCT_NAME}
|
||||
cd ${PRODUCT_NAME}
|
||||
|
||||
TAG_EXIST=`git tag -l ${TAG_NAME} | wc -l`
|
||||
|
||||
if [ ${TAG_EXIST} -ne 1 ]; then
|
||||
echo "Could not find the tag named" ${TAG_NAME}
|
||||
exit 1
|
||||
if [ -d "skywalking" ]; then
|
||||
rm -rf skywalking
|
||||
fi
|
||||
|
||||
git checkout ${TAG_NAME}
|
||||
echo "Cloning the repository..."
|
||||
git clone --recurse-submodules -j4 --depth 1 https://github.com/apache/skywalking.git && cd skywalking
|
||||
|
||||
git submodule init
|
||||
git submodule update
|
||||
echo "Checking out the release branch ${RELEASE_VERSION}-release..."
|
||||
git checkout -b ${RELEASE_VERSION}-release
|
||||
|
||||
# Generate a static version.properties and override the template when releasing source tar
|
||||
# because after that there is no Git information anymore.
|
||||
./mvnw -q -pl oap-server/server-starter initialize \
|
||||
-DgenerateGitPropertiesFilename="$(pwd)/oap-server/server-starter/src/main/resources/version.properties"
|
||||
log_file=$(mktemp)
|
||||
echo "Setting the release version ${RELEASE_VERSION} in pom.xml, log file: ${log_file}"
|
||||
${MVN} versions:set-property -DgenerateBackupPoms=false -Dproperty=revision -DnewVersion=${RELEASE_VERSION} > ${log_file} 2>&1
|
||||
|
||||
cd ..
|
||||
echo "Committing the pom.xml changes..."
|
||||
git add pom.xml
|
||||
git commit -m "Prepare for release ${RELEASE_VERSION}"
|
||||
|
||||
tar czf ${PRODUCT_NAME}-src.tgz \
|
||||
echo "Creating the release tag ${TAG}..."
|
||||
git tag ${TAG}
|
||||
|
||||
echo "Pushing the release tag ${TAG} to the remote repository..."
|
||||
git push --set-upstream origin ${TAG}
|
||||
|
||||
log_file=$(mktemp)
|
||||
echo "Generating a static version.properties, log file: ${log_file}"
|
||||
${MVN} -q -pl oap-server/server-starter -am initialize \
|
||||
-DgenerateGitPropertiesFilename="$(pwd)/oap-server/server-starter/src/main/resources/version.properties" > ${log_file} 2>&1
|
||||
|
||||
echo "Creating the release source artifacts..."
|
||||
tar czf "${SCRIPT_DIR}"/${PRODUCT_NAME}-${RELEASE_VERSION}-src.tar.gz \
|
||||
--exclude .git \
|
||||
--exclude .DS_Store \
|
||||
--exclude .github \
|
||||
--exclude .gitignore \
|
||||
--exclude .gitmodules \
|
||||
--exclude .mvn/wrapper/maven-wrapper.jar \
|
||||
${PRODUCT_NAME}
|
||||
.
|
||||
|
||||
gpg --armor --detach-sig ${PRODUCT_NAME}-src.tgz
|
||||
gpg --armor --detach-sig ${PRODUCT_NAME}.tar.gz
|
||||
log_file=$(mktemp)
|
||||
echo "Building the release binary artifacts, log file: ${log_file}"
|
||||
${MVN} install package -DskipTests > ${log_file} 2>&1
|
||||
mv dist/${PRODUCT_NAME}-bin.tar.gz "${SCRIPT_DIR}"/${PRODUCT_NAME}-${RELEASE_VERSION}-bin.tar.gz
|
||||
|
||||
shasum -a 512 ${PRODUCT_NAME}-src.tgz > ${PRODUCT_NAME}-src.tgz.sha512
|
||||
shasum -a 512 ${PRODUCT_NAME}.tar.gz > ${PRODUCT_NAME}.tar.gz.sha512
|
||||
cd "${SCRIPT_DIR}"
|
||||
gpg --armor --detach-sig ${PRODUCT_NAME}-${RELEASE_VERSION}-src.tar.gz
|
||||
gpg --armor --detach-sig ${PRODUCT_NAME}-${RELEASE_VERSION}-bin.tar.gz
|
||||
|
||||
shasum -a 512 ${PRODUCT_NAME}-${RELEASE_VERSION}-src.tar.gz > ${PRODUCT_NAME}-${RELEASE_VERSION}-src.tar.gz.sha512
|
||||
shasum -a 512 ${PRODUCT_NAME}-${RELEASE_VERSION}-bin.tar.gz > ${PRODUCT_NAME}-${RELEASE_VERSION}-bin.tar.gz.sha512
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# This script relies on few environment variables to determine source code package
|
||||
# behavior, those variables are:
|
||||
# RELEASE_VERSION -- The version of this source package.
|
||||
# NEXT_RELEASE_VERSION -- The version of the next release.
|
||||
# For example: RELEASE_VERSION=10.0.0, NEXT_RELEASE_VERSION=10.0.1
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
if [ "$RELEASE_VERSION" == "" ] || [ "$NEXT_RELEASE_VERSION" == "" ]; then
|
||||
echo "RELEASE_VERSION or NEXT_RELEASE_VERSION environment variable not found."
|
||||
echo "Please set the RELEASE_VERSION and NEXT_RELEASE_VERSION."
|
||||
echo "For example: export RELEASE_VERSION=10.0.0"
|
||||
echo " : export NEXT_RELEASE_VERSION=10.0.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v yq &> /dev/null; then
|
||||
echo "yq is not installed. Please install yq first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "skywalking" ]; then
|
||||
rm -rf skywalking
|
||||
fi
|
||||
|
||||
echo "Cloning the repository..."
|
||||
git clone --recurse-submodules -j4 --depth 1 https://github.com/apache/skywalking.git && cd skywalking
|
||||
|
||||
echo "Checking out the release branch ${RELEASE_VERSION}-release..."
|
||||
git checkout -b ${RELEASE_VERSION}-release
|
||||
|
||||
echo "Setting the next release version ${NEXT_RELEASE_VERSION} in pom.xml..."
|
||||
./mvnw versions:set-property -DgenerateBackupPoms=false -Dproperty=revision -DnewVersion=${NEXT_RELEASE_VERSION}-SNAPSHOT
|
||||
|
||||
echo "Committing the pom.xml changes..."
|
||||
git add pom.xml
|
||||
git commit -m "Update the next release version to ${NEXT_RELEASE_VERSION}-SNAPSHOT"
|
||||
|
||||
echo "Moving the changelog file..."
|
||||
mv docs/en/changes/changes.md docs/en/changes-$RELEASE_VERSION.md
|
||||
|
||||
echo "Updating the changelog file..."
|
||||
cat docs/en/changes/changes.tpl | sed "s/NEXT_RELEASE_VERSION/${NEXT_RELEASE_VERSION}/g" > docs/en/changes/changes.md
|
||||
|
||||
echo "Committing the changelog files..."
|
||||
git add docs
|
||||
git commit -m "Update the changelog files"
|
||||
|
||||
echo "Updating the menu.yml file..."
|
||||
new_menu_file=$(mktemp)
|
||||
major_version=$(echo ${RELEASE_VERSION} | cut -d. -f1)
|
||||
yq '(.catalog[] | select(.name=="Changelog") | .catalog[] | select(.name=="'"${major_version}.x Releases"'") | .catalog) |= [{ "name": "'"${RELEASE_VERSION}"'", "path": "/en/changes/changes-'${RELEASE_VERSION}'" }] + .' docs/menu.yml > ${new_menu_file}
|
||||
mv ${new_menu_file} docs/menu.yml
|
||||
git add docs
|
||||
git commit -m "Update the menu.yml file"
|
||||
|
||||
echo "Pushing the changes to the remote repository..."
|
||||
git push --set-upstream origin ${RELEASE_VERSION}-release
|
||||
|
||||
echo "Opening the PR..."
|
||||
open https://github.com/apache/skywalking/pull/new/${RELEASE_VERSION}-release
|
||||
Loading…
Reference in New Issue