Skip to content

Commit

Permalink
Add --top option to set release note alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
shalithasuranga committed Apr 17, 2022
1 parent 2f3f74a commit a464bf1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .releasezri/template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{RZ_TOP}

## What's new
{RZ_CHANGELOG}

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Wait!, you don't need to do this manually - use [ReleaseZri](https://github.com/

## Unreleased

### Core: script
- Add `RZ_TOP` template variable and set it via `--top=<content_mardown>`. This feature is helpful for adding
important messages about releases. i.e, Nightly build warning.

## v1.2.0

### Core: script
Expand Down
12 changes: 10 additions & 2 deletions scripts/rz.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
CHANGELOG_FILE = './CHANGELOG.md'
TMP_DIR = './.tmprz'
RELEASE_NOTE_FILE = './.tmprz/release_notes.md'
RZ_VERSION = '1.2.0'
RZ_VERSION = '1.3.0'
VERSION = ''
VERSION_WITH_V = ''

def get_cli_option_value(option):
for arg in sys.argv:
if option in arg:
return arg.split('=')[1]
return ''

def apply_notes_to_template(note):
md = ''
today = datetime.today()
Expand All @@ -23,7 +29,9 @@ def apply_notes_to_template(note):
.replace('{RZ_VERSION}', VERSION) \
.replace('{RZ_DATE}', today.strftime('%Y-%m-%d')) \
.replace('{RZ_TIME}', today.strftime('%H:%M:%S')) \
.replace('{RZ_CHANGELOG}', note)
.replace('{RZ_CHANGELOG}', note) \
.replace('{RZ_TOP}', get_cli_option_value('--top')) \
.strip()
return md

def parse_release_note():
Expand Down

0 comments on commit a464bf1

Please sign in to comment.