@@ -2,41 +2,81 @@ name: Release Test
22
33on : [push]
44
5+ env :
6+ ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
7+
58jobs :
69
7- package :
8- name : Create Package
10+ package_python3 :
11+ name : Create sdist and Python 3 Wheel
912 runs-on : ubuntu-latest
13+ outputs :
14+ sdist : ${{ steps.package.outputs.sdist }}
15+ wheel : ${{ steps.package.outputs.wheel }}
1016 container :
11- image : danielflook/python-minifier-build:python3.11-2022-10-25
17+ image : danielflook/python-minifier-build:python3.12-2024-01-12
1218 steps :
1319 - name : Checkout
1420 uses : actions/checkout@v3
1521 with :
1622 fetch-depth : 0
23+ show-progress : false
1724
1825 - name : Set version statically
1926 run : |
20- VERSION="$(python3 setup.py --version)"
27+ pip3 install setuptools_scm
28+ VERSION="$(python3 -m setuptools_scm)"
2129 sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py
2230
2331 - name : Create Packages
32+ id : package
2433 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"
2739
2840 - uses : actions/upload-artifact@v3
2941 with :
3042 name : dist
3143 path : dist/
3244 if-no-files-found : error
3345
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 :
3575 name : Test Documentation
3676 runs-on : ubuntu-latest
37- needs : [package ]
77+ needs : [package_python3 ]
3878 container :
39- image : danielflook/python-minifier-build:python3.11-2022-10-25
79+ image : danielflook/python-minifier-build:python3.12-2024-01-12
4080 steps :
4181 - uses : actions/download-artifact@v3
4282 with :
@@ -45,11 +85,14 @@ jobs:
4585
4686 - name : Install package
4787 run : |
48- pip3 install dist/*.tar.gz
88+ pip3 install dist/${{needs.package_python3.outputs.sdist}}
4989 pyminify --version
5090
5191 - name : Checkout
5292 uses : actions/checkout@v3
93+ with :
94+ fetch-depth : 0
95+ show-progress : false
5396
5497 - name : Build documentation
5598 run : |
@@ -59,13 +102,14 @@ jobs:
59102 test_package :
60103 name : Test Package
61104 runs-on : ubuntu-latest
62- needs : [package ]
105+ needs : [package_python3, package_python2 ]
63106 strategy :
107+ fail-fast : false
64108 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 ]
67111 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
69113 steps :
70114 - uses : actions/download-artifact@v3
71115 with :
@@ -74,11 +118,21 @@ jobs:
74118
75119 - name : Install package
76120 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+
78129 pyminify --version
79130
80131 - name : Checkout
81132 uses : actions/checkout@v3
133+ with :
134+ fetch-depth : 0
135+ show-progress : false
82136
83137 - name : Test pyminify
84138 run : |
@@ -90,12 +144,12 @@ jobs:
90144
91145 test_typing :
92146 runs-on : ubuntu-latest
93- needs : [package ]
147+ needs : [package_python3 ]
94148 strategy :
95149 matrix :
96- package_type : [.tar.gz, .whl ]
150+ package_type : [sdist, wheel ]
97151 container :
98- image : danielflook/python-minifier-build:python3.11-2022-10-25
152+ image : danielflook/python-minifier-build:python3.12-2024-01-12
99153 steps :
100154 - uses : actions/download-artifact@v3
101155 with :
@@ -104,19 +158,26 @@ jobs:
104158
105159 - name : Install package
106160 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
108166
109167 - name : Checkout
110168 uses : actions/checkout@v3
169+ with :
170+ fetch-depth : 0
171+ show-progress : false
111172
112173 - name : Test typing
113174 run : |
114- pip3.11 install mypy types-setuptools
175+ pip3.12 install mypy types-setuptools
115176 mypy --strict typing_test/test_typing.py
116177
117178 if mypy --strict typing_test/test_badtyping.py; then
118179 echo "Bad types weren't detected"
119180 exit 1
120181 fi
121182
122- stubtest python_minifier
183+ stubtest python_minifier --allowlist typing_test/stubtest-allowlist.txt
0 commit comments