-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1155 from RasaHQ/INFRA-1142
[INFRA-1142] DEV Release Workflow
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: DEV Release Workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to release' | ||
required: true | ||
base-branch: | ||
description: 'Base branch' | ||
required: true | ||
|
||
env: | ||
COMMIT_EMAIL: [email protected] | ||
DEFAULT_PYTHON_VERSION: "3.10" | ||
GITHUB_TOKEN: ${{ secrets.RASASDK_GITHUB_TOKEN }} | ||
|
||
jobs: | ||
prepare-dev-release: | ||
name: Prepare DEV Release | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check version format | ||
run: | | ||
version="$INPUT_VERSION" | ||
# Check if version is in format number.number.number.dev | ||
if ! [[ $version =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?\.dev[0-9]+$ ]]; then | ||
echo "Invalid version format. It should be in format 'number.number.number.dev'." | ||
exit 1 | ||
fi | ||
env: | ||
INPUT_VERSION: ${{ github.event.inputs.version }} | ||
|
||
- name: Check-out base branch | ||
run: | | ||
git checkout $BASE_BRANCH | ||
git branch | ||
env: | ||
BASE_BRANCH: ${{ github.event.inputs.base-branch }} | ||
|
||
- name: Setup Python Environment | ||
uses: ./.github/actions/setup-python-env | ||
with: | ||
PYTHON_VERSION: ${{ env.DEFAULT_PYTHON_VERSION }} | ||
|
||
- name: Prepare the release | ||
run: | | ||
git config user.name "rasabot" | ||
git config user.email "[email protected]" | ||
poetry run python scripts/release.py --next_version $INPUT_VERSION | ||
env: | ||
INPUT_VERSION: ${{ github.event.inputs.version }} | ||
|
||
- name: Create pull request | ||
uses: devops-infra/action-pull-request@e66e2ba93519dc63b9884a26e620e2fd0cffab2c # v0.5.5 | ||
with: | ||
github_token: ${{ env.GITHUB_TOKEN }} | ||
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: | ||
INPUT_VERSION: ${{ github.event.inputs.version }} |