9
9
# Daily at 3:11
10
10
- cron : " 11 3 * * *"
11
11
12
+ env :
13
+ PIP_DISABLE_PIP_VERSION_CHECK : " 1"
14
+ PIP_NO_PYTHON_VERSION_WARNING : " 1"
15
+
12
16
jobs :
13
17
pre-commit :
14
18
runs-on : ubuntu-latest
15
19
steps :
16
20
- uses : actions/checkout@v3
17
21
- uses : actions/setup-python@v4
18
22
with :
19
- python-version : " 3.11 "
23
+ python-version : " 3.x "
20
24
- uses : pre-commit/action@v3.0.0
21
25
26
+ list :
27
+ runs-on : ubuntu-latest
28
+ outputs :
29
+ noxenvs : ${{ steps.noxenvs-matrix.outputs.noxenvs }}
30
+ steps :
31
+ - uses : actions/checkout@v3
32
+ - name : Set up nox
33
+ uses : wntrblm/nox@2022.11.21
34
+ - id : noxenvs-matrix
35
+ run : |
36
+ echo >>$GITHUB_OUTPUT noxenvs=$(
37
+ nox --list-sessions |
38
+ grep '^* ' |
39
+ cut -d ' ' -f 2- |
40
+ jq --raw-input --slurp 'split("\n") | map(select(. != ""))'
41
+ )
42
+
22
43
ci :
44
+ needs : list
23
45
runs-on : ${{ matrix.os }}
24
46
strategy :
25
47
fail-fast : false
26
48
matrix :
27
49
os : [macos-latest, ubuntu-latest]
50
+ noxenv : ${{ fromJson(needs.list.outputs.noxenvs) }}
28
51
29
52
steps :
30
53
- uses : actions/checkout@v3
31
54
- name : Install dependencies
32
55
run : >
33
56
sudo apt-get update &&
34
57
sudo apt-get install -y libenchant-2-dev libxml2-dev libxslt-dev
35
- if : runner.os == 'Linux'
58
+ if : runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
36
59
- name : Install dependencies
37
60
run : brew install enchant
38
- if : runner.os == 'macOS'
61
+ if : runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
39
62
- name : Set up Python
40
63
uses : actions/setup-python@v4
41
64
with :
42
- python-version : " 3.11 "
65
+ python-version : " 3.x "
43
66
- name : Set up nox
44
67
uses : wntrblm/nox@2022.11.21
45
68
- name : Run nox
46
- run : nox
69
+ run : nox -s "${{ matrix.noxenv }}"
47
70
48
71
packaging :
49
72
needs : ci
@@ -54,28 +77,20 @@ jobs:
54
77
- name : Set up Python
55
78
uses : actions/setup-python@v4
56
79
with :
57
- python-version : " 3.11 "
80
+ python-version : " 3.x "
58
81
- name : Install dependencies
59
82
run : python -m pip install build
60
83
- name : Create packages
61
84
run : python -m build .
62
- - name : Set up nox
63
- uses : wntrblm/nox@2022.11.21
64
- - uses : actions/upload-artifact@v3
65
- with :
66
- name : dist
67
- path : dist
68
85
- name : Publish to PyPI
69
86
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
70
87
uses : pypa/gh-action-pypi-publish@release/v1
71
88
with :
72
- user : __token__
73
89
password : ${{ secrets.pypi_password }}
74
90
- name : Create a Release
75
91
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
76
92
uses : softprops/action-gh-release@v1
77
93
with :
78
94
files : |
79
- shiv/bowtie
80
95
dist/*
81
96
generate_release_notes : true
0 commit comments