-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27c4184
commit 7ce71a7
Showing
1 changed file
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,53 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Minor Release Check | ||
id: minor_release | ||
run: | | ||
version="$INPUT_VERSION" | ||
# Check if version is in format number.number.number | ||
if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Invalid version format. It should be in format 'number.number.number'." | ||
exit 1 | ||
fi | ||
# Extract the third number | ||
IFS='.' read -r -a version_parts <<< "$version" | ||
third_number="${version_parts[2]}" | ||
# Check if it's a minor release | ||
if [ "$third_number" -eq 0 ]; then | ||
echo "Minor release detected." | ||
echo "is_minor=true" >> $GITHUB_ENV | ||
else | ||
echo "Not a minor release. Skipping branch creation." | ||
echo "is_minor=false" >> $GITHUB_ENV | ||
fi | ||
- name: Create and Push New Release Branch | ||
if: env.is_minor == 'true' | ||
run: | | ||
version="$INPUT_VERSION" | ||
IFS='.' read -r -a version_parts <<< "$version" | ||
release_branch="${version_parts[0]}.${version_parts[1]}.x" | ||
git fetch origin | ||
git checkout origin/main | ||
git checkout -b $release_branch | ||
git push origin $release_branch | ||
- name: Check-out Release Branch | ||
run: | | ||
version="$INPUT_VERSION" | ||
IFS='.' read -r -a version_parts <<< "$version" | ||
release_branch="${version_parts[0]}.${version_parts[1]}.x" | ||
echo "base_branch=${version_parts[0]}.${version_parts[1]}.x" >> $GITHUB_ENV | ||
echo $base_branch | ||
git checkout $release_branch | ||
git branch | ||
- name: Setup Python Environment | ||
uses: ./.github/actions/setup-python-env | ||
|
@@ -38,7 +85,6 @@ jobs: | |
run: | | ||
git config user.name "rasabot" | ||
git config user.email "[email protected]" | ||
git checkout -b prepare-release-$INPUT_VERSION | ||
poetry run python scripts/release.py --next_version $INPUT_VERSION | ||
env: | ||
INPUT_VERSION: ${{ github.event.inputs.version }} | ||
|
@@ -47,8 +93,8 @@ jobs: | |
uses: devops-infra/action-pull-request@e66e2ba93519dc63b9884a26e620e2fd0cffab2c # v0.5.5 | ||
with: | ||
github_token: ${{ env.GITHUB_TOKEN }} | ||
source_branch: prepare-release-${{ env.VERSION }} | ||
target_branch: main | ||
source_branch: prepare-release-${{ env.INPUT_VERSION }} | ||
target_branch: ${{ env.base_branch }} | ||
body: "**Automated pull request for Rasa SDK release.**" | ||
title: Release ${{ github.event.inputs.version }} | ||
env: | ||
|