Skip to content

Commit 74be391

Browse files
committed
Feature(MInference): update release scripts
1 parent eb922ea commit 74be391

File tree

2 files changed

+56
-22
lines changed

2 files changed

+56
-22
lines changed

.github/workflows/release.yml

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
env:
8787
CMAKE_BUILD_TYPE: Release # do not compile with debug symbol to reduce wheel size
8888
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
9090
wheel_name=$(ls dist/*whl | xargs -n 1 basename)
9191
asset_name=${wheel_name//"linux"/"manylinux1"}
9292
echo "wheel_name=${wheel_name}" >> $GITHUB_ENV
@@ -106,24 +106,58 @@ jobs:
106106
with:
107107
name: ${{ env.asset_name }}
108108
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 }}
109150
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

.github/workflows/scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ export MAX_JOBS=1
1616
# Make sure release wheels are built for the following architectures
1717
export TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0+PTX"
1818
# Build
19-
$python_executable setup.py bdist_wheel --dist-dir=dist
19+
$python_executable setup.py $3 --dist-dir=dist

0 commit comments

Comments
 (0)