Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

Add nightly release workflow (#1255)

chen, suyueb4ab21d7aa4c
diff --git a/.github/workflows/nightly-binary-release.yml b/.github/workflows/nightly-binary-release.yml
new file mode 100644
index 000000000..1e3a256aa
--- /dev/null
+++ b/.github/workflows/nightly-binary-release.yml
@@ -0,0 +1,68 @@
+name: Nightly Binary Build and Publish
+
+permissions:
+ contents: read
+
+on:
+ schedule:
+ - cron: '0 18 * * *' # UTC 18:00, Beijing 02:00
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Version to publish (e.g. 0.9.5.dev20260101)'
+ required: false
+ type: string
+ test_pypi:
+ default: true
+ description: 'Publish to TestPyPI, for test only'
+ required: false
+ type: boolean
+
+jobs:
+ build-and-publish:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: '3.12'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip setuptools wheel twine
+
+ - name: Set nightly version
+ id: set_version
+ run: |
+ base_version=$(grep "__version__" auto_round/version.py | cut -d= -f2 | tr -d ' "')
+ if [ -z "${{ github.event.inputs.version }}" ]; then
+ VERSION="${base_version}.dev$(date -u +%Y%m%d)"
+ else
+ VERSION="${{ github.event.inputs.version }}"
+ fi
+ # Update version in setup.py (assumes version is set as version='...')
+ sed -i "s/version=get_build_version(),/version='$VERSION'/" setup.py
+ # Update project name in setup.py (assumes name='...')
+ sed -i "s/name=package_name,/name='auto-round-nightly'/" setup.py
+
+ - name: Build binary
+ run: |
+ python setup.py sdist bdist_wheel
+
+ - name: Publish to PyPI or TestPyPI
+ env:
+ TWINE_USERNAME: "__token__"
+ PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+ TESTPYPI_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
+ run: |
+ if [[ "${{ github.event.inputs.test_pypi }}" == "true" ]]; then
+ export TWINE_PASSWORD=${TESTPYPI_PASSWORD}
+ twine upload --repository testpypi dist/*
+ else
+ export TWINE_PASSWORD=${PYPI_PASSWORD}
+ twine upload --repository pypi dist/*
+ fi
+