44 release :
55 types : [created]
66 push :
7+ branches :
8+ - master
79 pull_request :
810 schedule :
911 # Runs every Thursday at 20:23 GMT to avoid bit rot
6971 - name : Install dependencies
7072 run : |
7173 python -m pip install --upgrade pip
72- pip install poetry
74+ pip install poetry twine
7375 poetry install
7476
7577 - name : Set Rust target environment variable
@@ -84,15 +86,17 @@ jobs:
8486 override : true
8587
8688 - name : Build Python package
87- if : matrix.architecture == 'x86'
88- run : poetry run maturin build --target ${{ env.ACTIONS_RUST_TARGET }}
89+ run : poetry run maturin build --interpreter python${{matrix.python_version}} --target ${{ env.ACTIONS_RUST_TARGET }}
8990
90- - name : Build Python package
91- if : matrix.architecture != 'x86'
92- run : poetry run maturin develop
91+ - name : Check wheels with Twine
92+ run : twine check target/wheels/*
93+ shell : bash
94+
95+ - name : Install Python package
96+ run : poetry run pip install target/wheels/adblock*.whl
97+ shell : bash
9398
9499 - name : Run Python tests
95- if : matrix.architecture != 'x86'
96100 run : poetry run pytest -vv --color=yes
97101
98102 python-publish :
@@ -133,10 +137,10 @@ jobs:
133137 - name : Install dependencies
134138 run : |
135139 python -m pip install --upgrade pip
136- pip install poetry
140+ pip install poetry twine
137141 poetry install
138142 - name : Build Python package
139- run : poetry run maturin build --release --no-sdist -- strip --interpreter python${{matrix.python_version}} --target ${{ env.ACTIONS_RUST_TARGET }}
143+ run : poetry run maturin build --release --strip --interpreter python${{matrix.python_version}} --target ${{ env.ACTIONS_RUST_TARGET }}
140144
141145 - name : List wheels
142146 if : matrix.os == 'windows-latest'
@@ -146,15 +150,9 @@ jobs:
146150 if : matrix.os != 'windows-latest'
147151 run : find ./target/wheels/
148152
149- # Note: Windows doesn't support glob
150- # https://stackoverflow.com/a/52481267/270334
151153 - name : Install wheels
152- if : matrix.os == 'windows-latest'
153- run : pip install --find-links=target\wheels adblock
154-
155- - name : Install wheels
156- if : matrix.os != 'windows-latest'
157154 run : pip install target/wheels/adblock*.whl
155+ shell : bash
158156
159157 - name : Release
160158 uses : softprops/action-gh-release@v1
@@ -167,8 +165,9 @@ jobs:
167165 - name : PyPi publish
168166 if : github.event_name == 'release' && github.event.action == 'created'
169167 env :
170- MATURIN_PASSWORD : ${{ secrets.PYPI }}
171- run : poetry run maturin publish --interpreter python${{matrix.python_version}} --username __token__
168+ TWINE_PASSWORD : ${{ secrets.PYPI }}
169+ run : twine upload --non-interactive --skip-existing --username __token__ target/wheels/*
170+ shell : bash
172171
173172 docs-publish :
174173 runs-on : ubuntu-latest
0 commit comments