Skip to content

Commit caac6e2

Browse files
Merge pull request #9 from deepsourcelabs/fix-release-pipeline-again
fix: release pipeline properly
2 parents b94dec9 + 9f9df5a commit caac6e2

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

.github/workflows/build_release.yml

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

33
on:
44
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
58

69
jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/.github/workflows/Python.yml
710
macos:
@@ -17,26 +20,26 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
1720
uses: PyO3/maturin-action@v1
1821
with:
1922
target: x86_64
20-
args: --release --out dist -m pydracula/Cargo.toml
23+
args: --release --out dist-x86-64 -m pydracula/Cargo.toml
2124
- name: Install built wheel - x86_64
2225
run: |
23-
pip install ./dist/pydracula-*.whl --force-reinstall
24-
rm -rf dist
26+
pip install ./dist-x86-64/pydracula-*.whl --force-reinstall
2527
python -c "import pydracula; pydracula.Lang"
2628
- name: Build wheels - universal2
2729
uses: PyO3/maturin-action@v1
2830
with:
29-
args: --release --universal2 --out dist -m pydracula/Cargo.toml
31+
args: --release --universal2 --out dist-universal2 -m pydracula/Cargo.toml
3032
- name: Install built wheel - universal2
3133
run: |
32-
pip install ./dist/pydracula-*.whl --force-reinstall
33-
rm -rf dist
34+
pip install ./dist-universal2/pydracula-*.whl --force-reinstall
3435
python -c "import pydracula; pydracula.Lang"
3536
- name: Upload wheels
3637
uses: actions/upload-artifact@v3
3738
with:
38-
name: wheels
39-
path: dist
39+
name: wheels-macos
40+
paths: |
41+
dist-x86-64
42+
dist-universal2
4043
4144
windows:
4245
runs-on: windows-latest
@@ -58,12 +61,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
5861
- name: Install built wheel
5962
run: |
6063
pip install pydracula --no-index --find-links dist --force-reinstall
61-
rmdir -r dist
6264
python -c "import pydracula; pydracula.Lang"
6365
- name: Upload wheels
6466
uses: actions/upload-artifact@v3
6567
with:
66-
name: wheels
68+
name: wheels-windows
6769
path: dist
6870

6971
linux:
@@ -87,12 +89,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
8789
if: matrix.target == 'x86_64'
8890
run: |
8991
pip install ./dist/pydracula-*.whl --force-reinstall
90-
rm -rf dist
9192
python -c "import pydracula; pydracula.Lang"
9293
- name: Upload wheels
9394
uses: actions/upload-artifact@v3
9495
with:
95-
name: wheels
96+
name: wheels-linux
9697
path: dist
9798

9899
linux-cross:
@@ -124,12 +125,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
124125
pip3 install -U pip
125126
run: |
126127
pip3 install ./dist/pydracula-*.whl --force-reinstall
127-
rm -rf dist
128128
python3 -c "import pydracula; pydracula.Lang"
129129
- name: Upload wheels
130130
uses: actions/upload-artifact@v3
131131
with:
132-
name: wheels
132+
name: wheels-linux-cross
133133
path: dist
134134

135135
musllinux:
@@ -161,12 +161,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
161161
apk add py3-pip
162162
pip3 install -U pip
163163
pip install ./dist/pydracula-*.whl --force-reinstall
164-
rm -rf dist
165164
python -c "import pydracula; pydracula.Lang"
166165
- name: Upload wheels
167166
uses: actions/upload-artifact@v3
168167
with:
169-
name: wheels
168+
name: wheels-musllinux
170169
path: dist
171170

172171
musllinux-cross:
@@ -200,12 +199,11 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
200199
pip3 install -U pip
201200
run: |
202201
pip install ./dist/pydracula-*.whl --force-reinstall
203-
rm -rf dist
204202
python -c "import pydracula; pydracula.Lang"
205203
- name: Upload wheels
206204
uses: actions/upload-artifact@v3
207205
with:
208-
name: wheels
206+
name: wheels-musllinux-cross
209207
path: dist
210208

211209
release:
@@ -214,9 +212,7 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
214212
if: "startsWith(github.ref, 'refs/tags/')"
215213
needs: [ macos, windows, linux, linux-cross, musllinux, musllinux-cross ]
216214
steps:
217-
- uses: actions/download-artifact@v3
218-
with:
219-
name: wheels
215+
- uses: actions/download-artifact@v3 # download all artifacts
220216
- uses: actions/setup-python@v4
221217
with:
222218
python-version: 3.9
@@ -226,4 +222,20 @@ jobs: # credits for workflow from https://github.com/messense/crfs-rs/blob/main/
226222
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
227223
run: |
228224
pip install --upgrade twine
225+
pushd wheels-musllinux-cross
226+
twine upload --skip-existing *
227+
popd
228+
pushd wheels-musllinux
229+
twine upload --skip-existing *
230+
popd
231+
pushd wheels-linux-cross
232+
twine upload --skip-existing *
233+
popd
234+
pushd wheels-linux
235+
twine upload --skip-existing *
236+
popd
237+
pushd wheels-windows
238+
twine upload --skip-existing *
239+
popd
240+
pushd wheels-macos
229241
twine upload --skip-existing *

0 commit comments

Comments
 (0)