File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
.github/actions/check-release Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,14 @@ runs:
33
33
fi
34
34
35
35
# Install Jupyter Releaser from git unless we are testing Releaser itself
36
- export repo_name =$(echo ${GITHUB_REPOSITORY} | cut -d'/' -f 2)
37
- echo "repo name: ${repo_name }"
38
- if [ ${repo_name } != "jupyter_releaser" ]; then
36
+ export RH_REPO_NAME =$(echo ${GITHUB_REPOSITORY} | cut -d'/' -f 2)
37
+ echo "repo name: ${RH_REPO_NAME }"
38
+ if [ ${RH_REPO_NAME } != "jupyter_releaser" ]; then
39
39
pip install git+https://github.com/jupyter-server/jupyter_releaser.git
40
40
fi
41
41
42
+ export RH_IS_CHECK_RELEASE=true
43
+
42
44
# Draft Changelog
43
45
python -m jupyter_releaser.actions.draft_changelog
44
46
Original file line number Diff line number Diff line change 1
1
# Copyright (c) Jupyter Development Team.
2
2
# Distributed under the terms of the Modified BSD License.
3
+ import os
4
+ import shutil
5
+ from pathlib import Path
6
+
7
+ from jupyter_releaser .util import CHECKOUT_NAME
8
+ from jupyter_releaser .util import log
3
9
from jupyter_releaser .util import run
4
10
11
+ check_release = os .environ .get ("RH_IS_CHECK_RELEASE" ).lower () == "true"
12
+
13
+ if check_release :
14
+ log ("Handling Check Release action" )
15
+
16
+ # Extract the changelog
17
+ changelog_location = os .environ .get ("RH_CHANGELOG" , "CHANGELOG.md" )
18
+ changelog_location = Path (CHECKOUT_NAME ) / changelog_location
19
+ changelog_text = changelog_location .read_text (encoding = "utf-8" )
20
+
21
+ # Remove the checkout
22
+ shutil .rmtree (CHECKOUT_NAME )
23
+
24
+ # Re-install the parent dir in case it was overshadowed
25
+ run ("pip install -e ." )
26
+
5
27
run ("jupyter-releaser prep-git" )
6
28
run ("jupyter-releaser bump-version" )
29
+
30
+ if check_release :
31
+ # Override the changelog
32
+ log ("Patching the changelog" )
33
+ log (changelog_text )
34
+ Path (changelog_location ).write_text (changelog_text )
35
+
7
36
run ("jupyter-releaser check-changelog" )
8
37
run ("jupyter-releaser check-links" )
9
38
# Make sure npm comes before python in case it produces
You can’t perform that action at this time.
0 commit comments