Skip to content

Commit 0e44426

Browse files
fix: release pipeline properly
1 parent b94dec9 commit 0e44426

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

.github/workflows/build_release.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: pydracula
22

33
on:
44
push:
5+
tags:
6+
- '*'
57

68
jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/.github/workflows/Python.yml
79
macos:
@@ -17,26 +19,26 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
1719
uses: PyO3/maturin-action@v1
1820
with:
1921
target: x86_64
20-
args: --release --out dist -m pydracula/Cargo.toml
22+
args: --release --out dist-x86-64 -m pydracula/Cargo.toml
2123
- name: Install built wheel - x86_64
2224
run: |
23-
pip install ./dist/pydracula-*.whl --force-reinstall
24-
rm -rf dist
25+
pip install ./dist-x86-64/pydracula-*.whl --force-reinstall
2526
python -c "import pydracula; pydracula.Lang"
2627
- name: Build wheels - universal2
2728
uses: PyO3/maturin-action@v1
2829
with:
29-
args: --release --universal2 --out dist -m pydracula/Cargo.toml
30+
args: --release --universal2 --out dist-universal2 -m pydracula/Cargo.toml
3031
- name: Install built wheel - universal2
3132
run: |
32-
pip install ./dist/pydracula-*.whl --force-reinstall
33-
rm -rf dist
33+
pip install ./dist-universal2/pydracula-*.whl --force-reinstall
3434
python -c "import pydracula; pydracula.Lang"
3535
- name: Upload wheels
3636
uses: actions/upload-artifact@v3
3737
with:
38-
name: wheels
39-
path: dist
38+
name: wheels-macos
39+
paths: |
40+
dist-x86-64
41+
dist-universal2
4042
4143
windows:
4244
runs-on: windows-latest
@@ -58,12 +60,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
5860
- name: Install built wheel
5961
run: |
6062
pip install pydracula --no-index --find-links dist --force-reinstall
61-
rmdir -r dist
6263
python -c "import pydracula; pydracula.Lang"
6364
- name: Upload wheels
6465
uses: actions/upload-artifact@v3
6566
with:
66-
name: wheels
67+
name: wheels-windows
6768
path: dist
6869

6970
linux:
@@ -87,12 +88,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
8788
if: matrix.target == 'x86_64'
8889
run: |
8990
pip install ./dist/pydracula-*.whl --force-reinstall
90-
rm -rf dist
9191
python -c "import pydracula; pydracula.Lang"
9292
- name: Upload wheels
9393
uses: actions/upload-artifact@v3
9494
with:
95-
name: wheels
95+
name: wheels-linux
9696
path: dist
9797

9898
linux-cross:
@@ -124,12 +124,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
124124
pip3 install -U pip
125125
run: |
126126
pip3 install ./dist/pydracula-*.whl --force-reinstall
127-
rm -rf dist
128127
python3 -c "import pydracula; pydracula.Lang"
129128
- name: Upload wheels
130129
uses: actions/upload-artifact@v3
131130
with:
132-
name: wheels
131+
name: wheels-linux-cross
133132
path: dist
134133

135134
musllinux:
@@ -161,12 +160,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
161160
apk add py3-pip
162161
pip3 install -U pip
163162
pip install ./dist/pydracula-*.whl --force-reinstall
164-
rm -rf dist
165163
python -c "import pydracula; pydracula.Lang"
166164
- name: Upload wheels
167165
uses: actions/upload-artifact@v3
168166
with:
169-
name: wheels
167+
name: wheels-musllinux
170168
path: dist
171169

172170
musllinux-cross:
@@ -200,12 +198,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
200198
pip3 install -U pip
201199
run: |
202200
pip install ./dist/pydracula-*.whl --force-reinstall
203-
rm -rf dist
204201
python -c "import pydracula; pydracula.Lang"
205202
- name: Upload wheels
206203
uses: actions/upload-artifact@v3
207204
with:
208-
name: wheels
205+
name: wheels-musllinux-cross
209206
path: dist
210207

211208
release:
@@ -214,9 +211,7 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
214211
if: "startsWith(github.ref, 'refs/tags/')"
215212
needs: [ macos, windows, linux, linux-cross, musllinux, musllinux-cross ]
216213
steps:
217-
- uses: actions/download-artifact@v3
218-
with:
219-
name: wheels
214+
- uses: actions/download-artifact@v3 # download all artifacts
220215
- uses: actions/setup-python@v4
221216
with:
222217
python-version: 3.9
@@ -226,4 +221,20 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
226221
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
227222
run: |
228223
pip install --upgrade twine
224+
pushd wheels-musllinux-cross
225+
twine upload --skip-existing *
226+
popd wheels-musllinux-cross
227+
pushd wheels-musllinux
228+
twine upload --skip-existing *
229+
popd wheels-musllinux
230+
pushd wheels-linux-cross
231+
twine upload --skip-existing *
232+
popd wheels-linux-cross
233+
pushd wheels-linux
234+
twine upload --skip-existing *
235+
popd wheels-linux
236+
pushd wheels-windows
237+
twine upload --skip-existing *
238+
popd wheels-windows
239+
pushd wheels-macos
229240
twine upload --skip-existing *

0 commit comments

Comments
 (0)