Skip to content

Commit 22f4b28

Browse files
Find wheel name using python
1 parent 26d705a commit 22f4b28

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ jobs:
2020
python setup.py bdist_wheel
2121
2222
- name: Capture wheel filename
23-
id: wheel_filename
2423
run: |
25-
WHEEL_FILE=$(ls dist/*.whl | head -n 1)
26-
echo "WHEEL_NAME=$WHEEL_FILE" >> $GITHUB_ENV
27-
echo "wheel_name=$WHEEL_FILE" >> $GITHUB_OUTPUT
24+
echo "WHEEL_NAME=$(python -c "import os, glob; print(glob.glob('dist/*.whl')[0])")" >> $GITHUB_ENV
2825
2926
- uses: actions/upload-artifact@v4
3027
with:
3128
name: wheel-artifact
32-
path: dist/*.whl
29+
path: ${{ env.WHEEL_NAME }}
3330

3431
test-linux:
3532
needs: build
@@ -49,8 +46,8 @@ jobs:
4946
name: wheel-artifact
5047
path: wheel-download
5148

52-
- name: Find wheel file
53-
run: echo "WHEEL_NAME=$(find wheel-download -name '*.whl' | head -n 1)" >> $GITHUB_ENV
49+
- name: Find wheel file (Python)
50+
run: echo "WHEEL_NAME=$(python -c "import os, glob; print(glob.glob('wheel-download/*.whl')[0])")" >> $GITHUB_ENV
5451

5552
- name: Install wheel
5653
run: pip install ${{ env.WHEEL_NAME }}
@@ -76,14 +73,11 @@ jobs:
7673
name: wheel-artifact
7774
path: wheel-download
7875

79-
- name: Find wheel file (Windows)
80-
shell: powershell
81-
run: |
82-
$WHEEL_FILE = Get-ChildItem -Path wheel-download -Filter "*.whl" | Select-Object -ExpandProperty FullName
83-
echo "WHEEL_NAME=$WHEEL_FILE" | Out-File -FilePath $env:GITHUB_ENV -Append
76+
- name: Find wheel file (Python)
77+
run: echo "WHEEL_NAME=$(python -c "import os, glob; print(glob.glob('wheel-download/*.whl')[0])")" >> $GITHUB_ENV
8478

8579
- name: Install wheel
86-
run: pip install "%WHEEL_NAME%"
80+
run: pip install ${{ env.WHEEL_NAME }}
8781

8882
- name: Test Import
8983
run: python -c "from lib3mf import get_wrapper"
@@ -106,8 +100,8 @@ jobs:
106100
name: wheel-artifact
107101
path: wheel-download
108102

109-
- name: Find wheel file (macOS)
110-
run: echo "WHEEL_NAME=$(find wheel-download -name '*.whl' | head -n 1)" >> $GITHUB_ENV
103+
- name: Find wheel file (Python)
104+
run: echo "WHEEL_NAME=$(python -c "import os, glob; print(glob.glob('wheel-download/*.whl')[0])")" >> $GITHUB_ENV
111105

112106
- name: Install wheel
113107
run: pip install ${{ env.WHEEL_NAME }}
@@ -134,8 +128,8 @@ jobs:
134128
name: wheel-artifact
135129
path: wheel-download
136130

137-
- name: Find wheel file
138-
run: echo "WHEEL_NAME=$(find wheel-download -name '*.whl' | head -n 1)" >> $GITHUB_ENV
131+
- name: Find wheel file (Python)
132+
run: echo "WHEEL_NAME=$(python -c "import os, glob; print(glob.glob('wheel-download/*.whl')[0])")" >> $GITHUB_ENV
139133

140134
- name: Install dependencies
141135
run: pip install twine

0 commit comments

Comments
 (0)