Update CICD flows to enable automated releases and match the feature … #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Candidate | |
on: | |
push: | |
branches: | |
- 'release/*' | |
create: | |
branches: | |
- 'release/*' | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run unit tests | |
run: tox -e test-unit | |
integration-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run integration tests | |
run: tox -e test-integration | |
e2e-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run end-to-end tests | |
run: tox -e test-e2e | |
build-and-publish: | |
needs: [unit-tests, integration-tests, e2e-tests] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install toml loguru tox | |
- name: Set environment variables | |
run: | | |
echo "GUIDELLM_BUILD_TYPE=release_candidate" >> $GITHUB_ENV | |
echo "GUIDELLM_BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Build the package | |
run: tox -e build | |
- name: Upload build artifacts | |
id: artifact-upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-candidate-artifacts | |
path: dist/* | |
compression-level: 6 | |
if-no-files-found: error | |
retention-days: 30 | |
- name: Log artifact location | |
run: | | |
echo "Artifacts uploaded to: https://api.github.com/repos/neuralmagic/guidellm/actions/artifacts/${{ steps.artifact-upload.outputs.artifact-id }}" | |
- name: Push wheel to PyPI | |
uses: neuralmagic/nm-actions/actions/[email protected] | |
with: | |
username: ${{ secrets.PYPI_PUBLIC_USER }} | |
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | |
whl: $(find dist -name '*.whl') | |
- name: Push tar.gz to PyPI | |
uses: neuralmagic/nm-actions/actions/[email protected] | |
with: | |
username: ${{ secrets.PYPI_PUBLIC_USER }} | |
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | |
whl: $(find dist -name '*.tar.gz') |