86
86
env :
87
87
CMAKE_BUILD_TYPE : Release # do not compile with debug symbol to reduce wheel size
88
88
run : |
89
- bash -x .github/workflows/scripts/build.sh ${{ matrix.python-version }} ${{ matrix.cuda-version }}
89
+ bash -x .github/workflows/scripts/build.sh ${{ matrix.python-version }} ${{ matrix.cuda-version }} bdist_wheel
90
90
wheel_name=$(ls dist/*whl | xargs -n 1 basename)
91
91
asset_name=${wheel_name//"linux"/"manylinux1"}
92
92
echo "wheel_name=${wheel_name}" >> $GITHUB_ENV
@@ -106,24 +106,58 @@ jobs:
106
106
with :
107
107
name : ${{ env.asset_name }}
108
108
path : ./dist/${{ env.wheel_name }}
109
+ publish_package :
110
+ name : Publish Python 🐍 distribution 📦 to PyPI
111
+ needs : [release]
112
+ runs-on : ${{ matrix.os }}
113
+ environment :
114
+ name : pypi
115
+ url : https://pypi.org/project/minference/
116
+ permissions :
117
+ id-token : write
118
+
119
+ strategy :
120
+ fail-fast : false
121
+ matrix :
122
+ os : ['ubuntu-20.04']
123
+ python-version : ['3.10']
124
+ pytorch-version : ['2.3.0'] # Must be the most recent version that meets requirements-cuda.txt.
125
+ cuda-version : ['12.1']
126
+
127
+ steps :
128
+ - name : Checkout
129
+ uses : actions/checkout@v4
130
+
131
+ - name : Setup ccache
132
+ uses :
hendrikmuhs/[email protected]
133
+ with :
134
+ create-symlink : true
135
+ key : ${{ github.job }}-${{ matrix.python-version }}-${{ matrix.cuda-version }}
136
+
137
+ - name : Set up Linux Env
138
+ if : ${{ runner.os == 'Linux' }}
139
+ run : |
140
+ bash -x .github/workflows/scripts/env.sh
141
+
142
+ - name : Set up Python
143
+ uses : actions/setup-python@v4
144
+ with :
145
+ python-version : ${{ matrix.python-version }}
146
+
147
+ - name : Install CUDA ${{ matrix.cuda-version }}
148
+ run : |
149
+ bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ${{ matrix.os }}
109
150
110
- # publish-to-pypi:
111
- # name: >-
112
- # Publish Python 🐍 distribution 📦 to PyPI
113
- # if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
114
- # needs: wheel
115
- # runs-on: ubuntu-latest
116
- # permissions:
117
- # id-token: write # IMPORTANT: mandatory for trusted publishing
118
-
119
- # steps:
120
- # - name: Download all the dists
121
- # uses: actions/download-artifact@v4
122
- # with:
123
- # path: dist/
124
- # - name: Pick the whl files
125
- # run: for file in dist/*;do mv $file ${file}1; done && cp dist/*/*.whl dist/ && rm -rf dist/*.whl1 && rm -rf dist/*+cu*
126
- # - name: Display structure of downloaded files
127
- # run: ls -R dist/
128
- # - name: Publish distribution 📦 to PyPI
129
- # uses: pypa/gh-action-pypi-publish@release/v1
151
+ - name : Install PyTorch ${{ matrix.pytorch-version }} with CUDA ${{ matrix.cuda-version }}
152
+ run : |
153
+ bash -x .github/workflows/scripts/pytorch-install.sh ${{ matrix.python-version }} ${{ matrix.pytorch-version }} ${{ matrix.cuda-version }}
154
+
155
+ - name : Build core package
156
+ run : |
157
+ bash -x .github/workflows/scripts/build.sh ${{ matrix.python-version }} ${{ matrix.cuda-version }} sdist
158
+ - name : Display structure of dist files
159
+ run : ls -R dist/
160
+ - name : Publish distribution 📦 to PyPI
161
+ uses : pypa/gh-action-pypi-publish@release/v1
162
+ with :
163
+ print-hash : true
0 commit comments