Skip to content

Commit

Permalink
[CI] Upload source package as well (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
CSY-ModelCloud authored Aug 13, 2024
1 parent 8f04caf commit 0390925
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 8 deletions.
73 changes: 65 additions & 8 deletions .github/workflows/build_wheels_cuda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ jobs:

- name: Test install
run: |
cd dist
whl=$(ls -t *.whl | head -n 1)
ls -ahl dist
whl=$(ls -t dist/*.gz | head -n 1 | xargs basename)
echo "WHL_NAME=$whl" >> $GITHUB_ENV
twine check $whl
pip install $whl
twine check dist/$whl
pip install dist/$whl
- name: Upload wheel
run: |
Expand Down Expand Up @@ -241,12 +241,12 @@ jobs:

- name: Test install
run: |
cd dist
whl=$(ls -t *.whl | head -n 1)
ls -ahl dist
whl=$(ls -t dist/*.gz | head -n 1 | xargs basename)
echo "WHL_NAME=$whl" >> $GITHUB_ENV
twine check $whl
pip install $whl
twine check dist/$whl
pip install dist/$whl
- name: Upload wheel
run: |
Expand All @@ -269,3 +269,60 @@ jobs:
file: dist/${{ env.WHL_NAME }}
tag: ${{ github.ref }}
file_glob: true

release-source:
strategy:
fail-fast: false
runs-on: self-hosted
needs: check-vm
container:
image: ${{ needs.check-vm.outputs.ip }}:5000/modelcloud/gptqmodel:compiler_cuda12.4-torch2.4-python3.11
env:
PYPI_RELEASE: true
steps:
- name: Print Env
run: |
echo "== pyenv =="
pyenv versions
echo "== python =="
python --version
echo "== nvcc =="
nvcc --version
echo "== torch =="
pip show torch
- name: Install requirements
run: pip install build -i http://${{ needs.check-vm.outputs.ip }}/simple/ --trusted-host ${{ needs.check-vm.outputs.ip }}

- name: Compile
run: python -m build --no-isolation --sdist

- name: Check dist
run: |
ls -ahl dist
whl=$(ls -t dist/*.gz | head -n 1 | xargs basename)
echo "WHL_NAME=$whl" >> $GITHUB_ENV
twine check dist/$whl
- name: Upload package
run: |
response=$(curl -s -F "runid=${{ github.run_id }}" -F "file=@dist/${{ env.WHL_NAME }}" http://${{ needs.check-vm.outputs.ip }}/gpu/whl/upload)
if [ "$response" -eq 1 ]; then
echo "UPLOADED=1" >> $GITHUB_ENV
fi
- name: Upload to artifact
uses: actions/upload-artifact@v4
continue-on-error: ${{ env.UPLOADED }} == '1'
with:
name: ${{ env.WHL_NAME }}
path: dist/${{ env.WHL_NAME }}

- name: Upload package to release
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
file: dist/${{ env.WHL_NAME }}
tag: ${{ github.ref }}
file_glob: true
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ global-include gptqmodel_ext/**/*.h
global-include gptqmodel_ext/**/*.cpp
global-include gptqmodel_ext/**/*.cu
global-include gptqmodel_ext/**/*.py
include requirements.txt

0 comments on commit 0390925

Please sign in to comment.