@@ -2,18 +2,19 @@ name: Test
2
2
on :
3
3
push :
4
4
pull_request :
5
- schedule :
6
- - cron : ' 15 23 * * 6' # M H d m w (Sat at 23:15)
5
+ schedule : [{cron: '15 23 * * 6'}] # M H d m w (Sat at 23:15)
7
6
jobs :
8
7
check :
9
8
if : github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
10
9
runs-on : ubuntu-latest
11
10
steps :
12
- - uses : actions/checkout@v2
13
- - uses : actions/setup-python@v2
11
+ - uses : actions/checkout@v3
12
+ - uses : actions/setup-python@v4
13
+ with :
14
+ python-version : ' 3.x'
14
15
- name : set PYSHA
15
16
run : echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
16
- - uses : actions/cache@v1
17
+ - uses : actions/cache@v3
17
18
with :
18
19
path : ~/.cache/pre-commit
19
20
key : pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
@@ -42,10 +43,10 @@ jobs:
42
43
matrix :
43
44
python : [2.7, 3.6, 3.9]
44
45
steps :
45
- - uses : actions/checkout@v2
46
+ - uses : actions/checkout@v3
46
47
with :
47
48
fetch-depth : 0
48
- - uses : actions/setup-python@v2
49
+ - uses : actions/setup-python@v4
49
50
with :
50
51
python-version : ${{ matrix.python }}
51
52
- run : pip install -U .[dev,nii,web]
@@ -62,14 +63,14 @@ jobs:
62
63
matrix :
63
64
python : [3.7, 3.9]
64
65
steps :
65
- - uses : actions/checkout@v2
66
+ - uses : actions/checkout@v3
66
67
with :
67
68
fetch-depth : 0
68
69
- name : Run setup-python
69
70
run : setup-python -p${{ matrix.python }}
70
71
- run : pip install -U .[dev,nii,cuda,web,mbeautify]
71
72
- run : pytest --durations-min=1
72
- - uses : codecov/codecov-action@v1
73
+ - uses : codecov/codecov-action@v3
73
74
- name : Post Run setup-python
74
75
run : setup-python -p${{ matrix.python }} -Dr
75
76
if : ${{ always() }}
@@ -78,10 +79,12 @@ jobs:
78
79
name : PyPI Deploy
79
80
runs-on : ubuntu-latest
80
81
steps :
81
- - uses : actions/checkout@v2
82
+ - uses : actions/checkout@v3
82
83
with :
83
84
fetch-depth : 0
84
- - uses : actions/setup-python@v2
85
+ - uses : actions/setup-python@v4
86
+ with :
87
+ python-version : ' 3.x'
85
88
- id : dist
86
89
uses : casperdcl/deploy-pypi@v2
87
90
with :
@@ -90,19 +93,11 @@ jobs:
90
93
gpg_key : ${{ secrets.GPG_KEY }}
91
94
password : ${{ secrets.PYPI_TOKEN }}
92
95
upload : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
93
- - id : meta
94
- name : Changelog
95
- run : |
96
- echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
97
- git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
98
96
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
99
- uses : softprops/action-gh-release@v1
97
+ name : Release
98
+ run : |
99
+ changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD)
100
+ tag="${GITHUB_REF#refs/tags/}"
101
+ gh release create --title "miutil $tag beta" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }} dist/${{ steps.dist.outputs.whl_asc }}
100
102
env :
101
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
102
- with :
103
- name : miutil ${{ steps.meta.outputs.tag }} beta
104
- body_path : _CHANGES.md
105
- draft : true
106
- files : |
107
- dist/${{ steps.dist.outputs.whl }}
108
- dist/${{ steps.dist.outputs.whl_asc }}
103
+ GH_TOKEN : ${{ github.token }}
0 commit comments