From 0390925375764b1158cae8e3894a12460e3d9cb5 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Tue, 13 Aug 2024 14:38:33 +0800 Subject: [PATCH] [CI] Upload source package as well (#355) --- .github/workflows/build_wheels_cuda_linux.yml | 73 +++++++++++++++++-- MANIFEST.in | 1 + 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_wheels_cuda_linux.yml b/.github/workflows/build_wheels_cuda_linux.yml index 2303de66..a08cf8df 100644 --- a/.github/workflows/build_wheels_cuda_linux.yml +++ b/.github/workflows/build_wheels_cuda_linux.yml @@ -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: | @@ -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: | @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in index 26a3cba0..be1ee189 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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