File tree Expand file tree Collapse file tree 5 files changed +77
-8
lines changed Expand file tree Collapse file tree 5 files changed +77
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : " Check Links"
2
+ description : " Run a link check function for a repo"
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - shell : bash
7
+ id : check-links
8
+ run : |
9
+ set -eux
10
+
11
+ # Set up env variables
12
+ export RH_REPOSITORY=${GITHUB_REPOSITORY}
13
+ export RH_REF=${GITHUB_REF}
14
+
15
+ if [ ! -z ${GITHUB_BASE_REF} ]; then
16
+ echo "Using GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
17
+ export RH_BRANCH=${GITHUB_BASE_REF}
18
+ else
19
+ # e.g refs/head/foo or refs/tag/bar
20
+ echo "Using GITHUB_REF: ${GITHUB_REF}"
21
+ export RH_BRANCH=$(echo ${GITHUB_REF} | cut -d'/' -f 3-)
22
+ fi
23
+
24
+ # Install Jupyter Releaser from git unless we are testing Releaser itself
25
+ if ! command -v jupyter-releaser &> /dev/null
26
+ then
27
+ pip install git+https://github.com/jupyter-server/jupyter_releaser.git
28
+ fi
29
+
30
+ jupyter-releaser prep-git
31
+ jupyter-releaser check-links --force
Original file line number Diff line number Diff line change 34
34
restore-keys : |
35
35
${{ runner.os }}-pip-
36
36
${{ runner.os }}-pip-
37
- - name : Cache checked links
38
- uses : actions/cache@v2
39
- with :
40
- path : ~/.cache/pytest-link-check
41
- key : ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md') }}-md-links
42
- restore-keys : |
43
- ${{ runner.os }}-linkcheck-
44
37
- name : Print env
45
38
run : env
46
39
- name : Upgrade packaging dependencies
Original file line number Diff line number Diff line change 29
29
echo "or after-the-fact on already committed files with"
30
30
echo " pre-commit run --all-files"
31
31
32
+ check-links :
33
+ runs-on : ubuntu-20.04
34
+
35
+ steps :
36
+ - uses : actions/checkout@v2
37
+ - uses : actions/setup-python@v2
38
+ with :
39
+ python-version : 3.9
40
+ - name : Get pip cache dir
41
+ id : pip-cache
42
+ run : |
43
+ echo "::set-output name=dir::$(pip cache dir)"
44
+ - name : Cache pip
45
+ uses : actions/cache@v2
46
+ with :
47
+ path : ${{ steps.pip-cache.outputs.dir }}
48
+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
49
+ restore-keys : |
50
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
51
+ ${{ runner.os }}-pip-
52
+ - name : Install the Python dependencies
53
+ run : |
54
+ pip install -e .[test] codecov
55
+ - name : Cache checked links
56
+ uses : actions/cache@v2
57
+ with :
58
+ path : ~/.cache/pytest-link-check
59
+ key : ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md') }}-md-links
60
+ restore-keys : |
61
+ ${{ runner.os }}-linkcheck-
62
+ - name : Install the Python dependencies
63
+ run : |
64
+ pip install -e .[test] codecov
65
+ - name : Check Links
66
+ uses : ./.github/actions/check-links
67
+
32
68
build :
33
69
runs-on : ${{ matrix.os }}-latest
34
70
strategy :
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ def invoke(self, ctx):
51
51
hooks = config .get ("hooks" , {})
52
52
options = config .get ("options" , {})
53
53
skip = config .get ("skip" , [])
54
+ if "--force" in ctx .args :
55
+ skip = []
56
+ ctx .args .remove ("--force" )
54
57
55
58
# Print a separation header
56
59
util .log (f'\n \n { "-" * 50 } ' )
@@ -119,7 +122,10 @@ def list_commands(self, ctx):
119
122
120
123
121
124
@click .group (cls = ReleaseHelperGroup )
122
- def main ():
125
+ @click .option (
126
+ "--force" , default = False , help = "Force a command to run even when skipped by config"
127
+ )
128
+ def main (force ):
123
129
"""Jupyter Releaser scripts"""
124
130
pass
125
131
Original file line number Diff line number Diff line change @@ -19,5 +19,8 @@ tag_template = "v{new_version}"
19
19
[[tool .tbump .file ]]
20
20
src = " jupyter_releaser/__init__.py"
21
21
22
+ [tool .jupyter-releaser ]
23
+ skip = [" check-links" ]
24
+
22
25
[tool .jupyter-releaser .hooks ]
23
26
after-draft-release = " bash ./.github/scripts/bump_tag.sh"
You can’t perform that action at this time.
0 commit comments