diff --git a/.github/workflows/build-wheels-release-rocm.yml b/.github/workflows/build-wheels-release-rocm.yml index ee28202..ece174b 100644 --- a/.github/workflows/build-wheels-release-rocm.yml +++ b/.github/workflows/build-wheels-release-rocm.yml @@ -2,12 +2,12 @@ name: Build ROCm 5.6 Wheels & Release on: workflow_dispatch: - inputs: - pypi: - description: 'Upload wheels to PyPI? 1 = yes, 0 = no' - default: '0' - required: true - type: string + # inputs: + # pypi: + # description: 'Upload wheels to PyPI? 1 = yes, 0 = no' + # default: '0' + # required: true + # type: string workflow_call: inputs: pypi: @@ -67,12 +67,13 @@ jobs: - name: Build Wheel id: build-wheel run: | - if ($(Get-Content 'setup.py' -raw) -match 'version = "(\d+\.(?:\d+\.?)*)" \+ \(') + $versionString = Get-Content $(Join-Path 'exllamav2' 'version.py') -raw + if ($versionString -match '__version__ = "(\d+\.(?:\d+\.?(?:dev\d+)?)*)"') { - Write-Output $('::notice file=build-wheels-release-rocm.yml,line=72,title=Package Version::Detected package version is: {0}' -f $Matches[1]) + Write-Output $('::notice file=build-wheels-release-rocm.yml,line=73,title=Package Version::Detected package version is: {0}' -f $Matches[1]) Write-Output "PACKAGE_VERSION=$($Matches[1])" >> "$env:GITHUB_OUTPUT" } else { - Write-Output '::error file=build-wheels-release.yml,line=75::Could not parse version from setup.py! You must upload wheels manually!' + Write-Output '::error file=build-wheels-release.yml,line=76::Could not parse version from exllamav2/version.py! You must upload wheels manually!' Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT" } @@ -90,28 +91,28 @@ jobs: uses: svenstaro/upload-release-action@2.6.1 with: file: ./dist/*.whl - tag: ${{ steps.build-wheel.outputs.PACKAGE_VERSION }} + tag: ${{ format('v{0}', steps.build-wheel.outputs.PACKAGE_VERSION) }} file_glob: true overwrite: true release_name: ${{ steps.build-wheel.outputs.PACKAGE_VERSION }} - publish-to-pypi: - name: Publish Python distribution to PyPI - if: inputs.pypi == '1' && github.event_name != 'workflow_call' - needs: ['build_wheels','build_rocm'] - runs-on: ubuntu-latest - - environment: - name: pypi - url: https://pypi.org/p/exllamav2 - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: Download all the wheels - uses: actions/download-artifact@v3 - with: - name: wheels - path: dist/ - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.10 + # publish-to-pypi: + # name: Publish Python distribution to PyPI + # if: inputs.pypi == '1' && github.event_name != 'workflow_call' + # needs: ['build_wheels'] + # runs-on: ubuntu-latest + # + # environment: + # name: pypi + # url: https://pypi.org/p/exllamav2 + # permissions: + # id-token: write # IMPORTANT: mandatory for trusted publishing + # + # steps: + # - name: Download all the wheels + # uses: actions/download-artifact@v3 + # with: + # name: wheels + # path: dist/ + # - name: Publish distribution to PyPI + # uses: pypa/gh-action-pypi-publish@v1.8.10 diff --git a/.github/workflows/build-wheels-release.yml b/.github/workflows/build-wheels-release.yml index bd41311..82fe8df 100644 --- a/.github/workflows/build-wheels-release.yml +++ b/.github/workflows/build-wheels-release.yml @@ -77,23 +77,24 @@ jobs: - name: Build Wheel id: build-wheel run: | - if ($(Get-Content 'setup.py' -raw) -match 'version = "(\d+\.(?:\d+\.?)*)" \+ \(') + $versionString = Get-Content $(Join-Path 'exllamav2' 'version.py') -raw + if ($versionString -match '__version__ = "(\d+\.(?:\d+\.?(?:dev\d+)?)*)"') { - Write-Output $('::notice file=build-wheels-release.yml,line=82,title=Package Version::Detected package version is: {0}' -f $Matches[1]) + Write-Output $('::notice file=build-wheels-release.yml,line=83,title=Package Version::Detected package version is: {0}' -f $Matches[1]) Write-Output "PACKAGE_VERSION=$($Matches[1])" >> "$env:GITHUB_OUTPUT" } else { - Write-Output '::error file=build-wheels-release.yml,line=85::Could not parse version from setup.py! You must upload wheels manually!' + Write-Output '::error file=build-wheels-release.yml,line=86::Could not parse version from exllamav2/version.py! You must upload wheels manually!' Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT" } $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX + if ($IsLinux) {$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH} $cudaVersion = $env:CUDAVER $cudaVersionPytorch = $env:CUDAVER.Remove($env:CUDAVER.LastIndexOf('.')).Replace('.','') $BUILDTAG = "+cu$cudaVersionPytorch" - if ($IsLinux) {$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH} $env:TORCH_CUDA_ARCH_LIST = if ([version]$env:CUDAVER -lt [version]'11.8') {'6.0 6.1 7.0 7.5 8.0 8.6+PTX'} else {'6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX'} python -m build -n --wheel -C--build-option=egg_info "-C--build-option=--tag-build=$BUILDTAG" @@ -166,7 +167,7 @@ jobs: Write-Output $('::notice file=build-wheels-release.yml,line=166,title=Package Version::Detected package version is: {0}' -f $Matches[1]) Write-Output "PACKAGE_VERSION=$($Matches[1])" >> "$env:GITHUB_OUTPUT" } else { - Write-Output '::error file=build-wheels-release.yml,line=169::Could not parse version from setup.py! You must upload wheels manually!' + Write-Output '::error file=build-wheels-release.yml,line=169::Could not parse version from exllamav2/version.py! You must upload wheels manually!' Write-Output "PACKAGE_VERSION=None" >> "$env:GITHUB_OUTPUT" }