Skip to content

Commit

Permalink
Merge pull request #118 from fcollonval/fix/restore-since
Browse files Browse the repository at this point in the history
Restore capture of since parameter
  • Loading branch information
Steven Silvester authored Aug 23, 2021
2 parents e1110b4 + 2c267d5 commit 6758413
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions jupyter_releaser/actions/draft_changelog.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os

from jupyter_releaser.util import CHECKOUT_NAME
from jupyter_releaser.util import get_latest_tag
from jupyter_releaser.util import log
from jupyter_releaser.util import run

run("jupyter-releaser prep-git")

# Capture the "since" argument in case we add tags befor checking changelog
# Do this before bumping the version
if not os.environ.get("RH_SINCE"):
curr_dir = os.getcwd()
os.chdir(CHECKOUT_NAME)
since = get_latest_tag(os.environ["RH_BRANCH"]) or ""
if since:
log(f"Capturing {since} in RH_SINCE variable")
os.environ["RH_SINCE"] = since
os.chdir(curr_dir)

run("jupyter-releaser bump-version")
run("jupyter-releaser build-changelog")
run("jupyter-releaser draft-changelog")
13 changes: 13 additions & 0 deletions jupyter_releaser/actions/draft_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from jupyter_releaser.changelog import extract_current
from jupyter_releaser.util import CHECKOUT_NAME
from jupyter_releaser.util import get_latest_tag
from jupyter_releaser.util import log
from jupyter_releaser.util import run

Expand All @@ -31,6 +32,18 @@
run("pip install -q -e .")

run("jupyter-releaser prep-git")

# Capture the "since" argument in case we add tags befor checking changelog
# Do this before bumping the version
if not os.environ.get("RH_SINCE"):
curr_dir = os.getcwd()
os.chdir(CHECKOUT_NAME)
since = get_latest_tag(os.environ["RH_BRANCH"]) or ""
if since:
log(f"Capturing {since} in RH_SINCE variable")
os.environ["RH_SINCE"] = since
os.chdir(curr_dir)

run("jupyter-releaser bump-version")

if check_release:
Expand Down

0 comments on commit 6758413

Please sign in to comment.