Skip to content

Commit

Permalink
added new flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanatbek Saribaev committed Jan 30, 2025
1 parent a3d811e commit 7fc0471
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
7 changes: 4 additions & 3 deletions .github/scripts/python/create_release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import semver
import requests


Expand All @@ -7,7 +8,6 @@
REPO_NAME = os.getenv("REPO_NAME")
ACCESS_TOKEN = os.getenv("ACCESS_TOKEN")
TAG_NAME = os.getenv("TAG_NAME")
RELEASE_BRANCH = os.getenv("RELEASE_BRANCH")
RELEASE_NAME = f"{TAG_NAME} Deckhouse Kubernetes Platform"
RELEASE_BODY = os.getenv("RELEASE_BODY")
MILESTONE_TITLE = os.getenv("MILESTONE_TITLE")
Expand Down Expand Up @@ -44,11 +44,12 @@ def create_github_release():
"Authorization": f"Bearer {ACCESS_TOKEN}",
"Accept": "application/vnd.github.v3+json"
}

version = semver.VersionInfo.parse(TAG_NAME[1:]) # Убираем 'v' перед парсингом
release_branch =f"release-{version.minor}"
url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/releases"
data = {
"tag_name": TAG_NAME,
"target_commitish": RELEASE_BRANCH,
"target_commitish": release_branch,
"name": RELEASE_NAME,
"body": f"{RELEASE_BODY}",
"draft": DRAFT,
Expand Down
5 changes: 0 additions & 5 deletions .github/workflow_templates/create_realese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ on:
tag_name:
description: 'Tag name for the release (e.g., v1.0.0)'
required: true
release_branch:
description: 'Release branch for the release (e.g., release-1.67.9)'
required: true

jobs:
create-release:
permissions: write-all
Expand Down Expand Up @@ -58,7 +54,6 @@ jobs:
REPO_NAME: ${{ github.event.repository.name }}
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.inputs.tag_name }}
RELEASE_BRANCH: ${{ github.event.inputs.release_branch }}
RELEASE_BODY: ${{ steps.changelog.outputs.release_markdown }}
MILESTONE_TITLE: ${{ github.event.inputs.tag_name }}
shell: bash
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/create_realese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ on:
tag_name:
description: 'Tag name for the release (e.g., v1.0.0)'
required: true
release_branch:
description: 'Release branch for the release (e.g., release-1.67.9)'
required: true

jobs:
create-release:
permissions: write-all
Expand Down Expand Up @@ -67,7 +63,6 @@ jobs:
REPO_NAME: ${{ github.event.repository.name }}
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.inputs.tag_name }}
RELEASE_BRANCH: ${{ github.event.inputs.release_branch }}
RELEASE_BODY: ${{ steps.changelog.outputs.release_markdown }}
MILESTONE_TITLE: ${{ github.event.inputs.tag_name }}
shell: bash
Expand Down

0 comments on commit 7fc0471

Please sign in to comment.