@@ -2,41 +2,81 @@ name: Release Test
2
2
3
3
on : [push]
4
4
5
+ env :
6
+ ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
7
+
5
8
jobs :
6
9
7
- package :
8
- name : Create Package
10
+ package_python3 :
11
+ name : Create sdist and Python 3 Wheel
9
12
runs-on : ubuntu-latest
13
+ outputs :
14
+ sdist : ${{ steps.package.outputs.sdist }}
15
+ wheel : ${{ steps.package.outputs.wheel }}
10
16
container :
11
- image : danielflook/python-minifier-build:python3.11-2022-10-25
17
+ image : danielflook/python-minifier-build:python3.12-2024-01-12
12
18
steps :
13
19
- name : Checkout
14
20
uses : actions/checkout@v3
15
21
with :
16
22
fetch-depth : 0
23
+ show-progress : false
17
24
18
25
- name : Set version statically
19
26
run : |
20
- VERSION="$(python3 setup.py --version)"
27
+ pip3 install setuptools_scm
28
+ VERSION="$(python3 -m setuptools_scm)"
21
29
sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py
22
30
23
31
- name : Create Packages
32
+ id : package
24
33
run : |
25
- pip3 install --upgrade setuptools wheel twine
26
- python3 setup.py sdist bdist_wheel --universal
34
+ pip3 install --upgrade build
35
+ python3 -m build
36
+
37
+ echo "sdist=$(find dist -name '*.tar.gz' -printf "%f\n")" >> "$GITHUB_OUTPUT"
38
+ echo "wheel=$(find dist -name '*-py3-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
27
39
28
40
- uses : actions/upload-artifact@v3
29
41
with :
30
42
name : dist
31
43
path : dist/
32
44
if-no-files-found : error
33
45
34
- test_docs :
46
+ package_python2 :
47
+ name : Create Python 2 Wheel
48
+ runs-on : ubuntu-latest
49
+ needs : [package_python3]
50
+ outputs :
51
+ wheel : ${{ steps.package.outputs.wheel }}
52
+ container :
53
+ image : danielflook/python-minifier-build:python2.7-2024-01-12
54
+ steps :
55
+ - uses : actions/download-artifact@v3
56
+ with :
57
+ name : dist
58
+ path : dist/
59
+
60
+ - name : Build wheel
61
+ id : package
62
+ run : |
63
+ dnf install -y findutils
64
+ pip install --upgrade wheel
65
+ pip wheel dist/${{ needs.package_python3.outputs.sdist }} -w dist
66
+ echo "wheel=$(find dist -name '*-py2-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
67
+
68
+ - uses : actions/upload-artifact@v3
69
+ with :
70
+ name : dist
71
+ path : dist/
72
+ if-no-files-found : error
73
+
74
+ documentation :
35
75
name : Test Documentation
36
76
runs-on : ubuntu-latest
37
- needs : [package ]
77
+ needs : [package_python3 ]
38
78
container :
39
- image : danielflook/python-minifier-build:python3.11-2022-10-25
79
+ image : danielflook/python-minifier-build:python3.12-2024-01-12
40
80
steps :
41
81
- uses : actions/download-artifact@v3
42
82
with :
@@ -45,11 +85,14 @@ jobs:
45
85
46
86
- name : Install package
47
87
run : |
48
- pip3 install dist/*.tar.gz
88
+ pip3 install dist/${{needs.package_python3.outputs.sdist}}
49
89
pyminify --version
50
90
51
91
- name : Checkout
52
92
uses : actions/checkout@v3
93
+ with :
94
+ fetch-depth : 0
95
+ show-progress : false
53
96
54
97
- name : Build documentation
55
98
run : |
@@ -59,13 +102,14 @@ jobs:
59
102
test_package :
60
103
name : Test Package
61
104
runs-on : ubuntu-latest
62
- needs : [package ]
105
+ needs : [package_python3, package_python2 ]
63
106
strategy :
107
+ fail-fast : false
64
108
matrix :
65
- python : ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
66
- package_type : [.tar.gz, .whl ]
109
+ python : ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
110
+ package_type : [sdist, wheel ]
67
111
container :
68
- image : danielflook/python-minifier-build:python${{ matrix.python }}-2022-10-25
112
+ image : danielflook/python-minifier-build:python${{ matrix.python }}-2024-01-12
69
113
steps :
70
114
- uses : actions/download-artifact@v3
71
115
with :
@@ -74,11 +118,21 @@ jobs:
74
118
75
119
- name : Install package
76
120
run : |
77
- pip${{ matrix.python }} install dist/*${{ matrix.package_type }}
121
+ if [[ "${{ matrix.package_type }}" == "sdist" ]]; then
122
+ pip${{ matrix.python }} install dist/${{needs.package_python3.outputs.sdist}}
123
+ elif [[ "${{ matrix.python }}" == "2.7" ]]; then
124
+ pip${{ matrix.python }} install dist/${{needs.package_python2.outputs.wheel}}
125
+ else
126
+ pip${{ matrix.python }} install dist/${{needs.package_python3.outputs.wheel}}
127
+ fi
128
+
78
129
pyminify --version
79
130
80
131
- name : Checkout
81
132
uses : actions/checkout@v3
133
+ with :
134
+ fetch-depth : 0
135
+ show-progress : false
82
136
83
137
- name : Test pyminify
84
138
run : |
@@ -90,12 +144,12 @@ jobs:
90
144
91
145
test_typing :
92
146
runs-on : ubuntu-latest
93
- needs : [package ]
147
+ needs : [package_python3 ]
94
148
strategy :
95
149
matrix :
96
- package_type : [.tar.gz, .whl ]
150
+ package_type : [sdist, wheel ]
97
151
container :
98
- image : danielflook/python-minifier-build:python3.11-2022-10-25
152
+ image : danielflook/python-minifier-build:python3.12-2024-01-12
99
153
steps :
100
154
- uses : actions/download-artifact@v3
101
155
with :
@@ -104,19 +158,26 @@ jobs:
104
158
105
159
- name : Install package
106
160
run : |
107
- pip3.11 install dist/*${{ matrix.package_type }}
161
+ if [[ "${{ matrix.package_type }}" == "sdist" ]]; then
162
+ pip3.12 install dist/${{needs.package_python3.outputs.sdist}}
163
+ else
164
+ pip3.12 install dist/${{needs.package_python3.outputs.wheel}}
165
+ fi
108
166
109
167
- name : Checkout
110
168
uses : actions/checkout@v3
169
+ with :
170
+ fetch-depth : 0
171
+ show-progress : false
111
172
112
173
- name : Test typing
113
174
run : |
114
- pip3.11 install mypy types-setuptools
175
+ pip3.12 install mypy types-setuptools
115
176
mypy --strict typing_test/test_typing.py
116
177
117
178
if mypy --strict typing_test/test_badtyping.py; then
118
179
echo "Bad types weren't detected"
119
180
exit 1
120
181
fi
121
182
122
- stubtest python_minifier
183
+ stubtest python_minifier --allowlist typing_test/stubtest-allowlist.txt
0 commit comments