File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,25 @@ jobs:
9595 fi
9696
9797 - name : Upload Python Wheels
98- uses : actions/upload-release-asset@v1
99- env :
100- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101- with :
102- upload_url : ${{ needs.create-release.outputs.upload_url }}
103- asset_path : ${{ github.workspace }}/target/wheels/*.whl
104- asset_name : image_to_console_python-${{ matrix.target }}.whl
105- asset_content_type : application/octet-stream
98+ shell : bash
99+ run : |
100+ shopt -s nullglob
101+ wheel_files=(${{ github.workspace }}/target/wheels/*.whl)
102+ if [ ${#wheel_files[@]} -gt 0 ]; then
103+ for wheel in "${wheel_files[@]}"; do
104+ echo "Uploading wheel: $wheel"
105+ upload_url=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
106+ "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}" \
107+ | jq -r '.upload_url' | sed 's/{?name,label}//')
108+ curl -sS -X POST \
109+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
110+ -H "Content-Type: application/octet-stream" \
111+ --data-binary "@$wheel" \
112+ "${upload_url}?name=$(basename "$wheel")"
113+ done
114+ else
115+ echo "No wheel files found"
116+ fi
106117
107118 - name : Upload Release Asset
108119 uses : actions/upload-release-asset@v1
You can’t perform that action at this time.
0 commit comments