-
Notifications
You must be signed in to change notification settings - Fork 456
111 lines (106 loc) · 3.17 KB
/
pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: publish to pypi
on:
push:
branches:
- main
paths:
- "lmdeploy/version.py"
workflow_dispatch:
jobs:
linux-build:
strategy:
matrix:
pyver: [py38, py39, py310, py311]
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.pyver }}
PLAT_NAME: manylinux2014_x86_64
DOCKER_TAG: cuda11.8
OUTPUT_FOLDER: cuda11.8_dist
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false
docker-images: false
# All of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false
- name: Checkout repository
uses: actions/checkout@v3
- name: Build
run: |
echo ${PYTHON_VERSION}
echo ${PLAT_NAME}
echo ${DOCKER_TAG}
echo ${OUTPUT_FOLDER}
# remove -it
sed -i 's/docker run --rm -it/docker run --rm/g' builder/manywheel/build_wheel.sh
bash builder/manywheel/build_wheel.sh ${PYTHON_VERSION} ${PLAT_NAME} ${DOCKER_TAG} ${OUTPUT_FOLDER}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
path: builder/manywheel/${{ env.OUTPUT_FOLDER }}/*
retention-days: 1
windows-build:
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10', '3.11']
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyver }}
- name: Install python packages
run: |
pip install pybind11 wheel
- uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '11.8.0'
use-github-cache: false
- name: Build wheel
run: |
mkdir build
cd build
# https://github.com/pypa/setuptools/issues/1631
pip install -U setuptools
..\builder\windows\generate.ps1
cmake --build . --config Release -- /m > build.log.txt
cmake --install . --config Release
cd ..
rm build -Force -Recurse
python setup.py bdist_wheel -d build/wheel
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
path: build/wheel/*
retention-days: 1
publish:
runs-on: ubuntu-latest
environment: 'prod'
needs:
- linux-build
- windows-build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Display artifacts
run: ls artifact/ -lh
- name: Set up python3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Upload to pypi
run: |
pip install twine
twine upload artifact/* -u __token__ -p ${{ secrets.pypi_password }}