Move reusable workflows to subdir #98
Workflow file for this run
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 | ||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| jobs: | ||
| tests: | ||
| strategy: | ||
| matrix: | ||
| python: ["3.10", "3.11", "3.12", "3.13"] | ||
| uses: ./.github/workflows/reusable/testing.yml | ||
| with: | ||
| python: ${{ matrix.python }} | ||
| ui-tests: | ||
| uses: ./.github/workflows/reusable/ui-testing.yml | ||
| build-and-publish: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python: ["3.10"] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
| - name: Install dependencies | ||
| run: | | ||
| curl -sSL https://pdm-project.org/install-pdm.py | python3 - | ||
| pip install tox tox-pdm | ||
| - name: Build the package | ||
| run: | | ||
| export GUIDELLM_BUILD_TYPE=release | ||
| tox -e build | ||
| - name: Upload build artifacts | ||
| id: artifact-upload | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-artifacts | ||
| path: dist/* | ||
| compression-level: 6 | ||
| if-no-files-found: error | ||
| retention-days: 90 | ||
| - name: Log artifact location | ||
| run: | | ||
| echo "Artifacts uploaded to: ${{ steps.artifact-upload.outputs.artifact-url }}" | ||
| - 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') | ||
| publish-versioned-ui-build: | ||
| needs: [ui-tests] | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v3 | ||
| - name: Set up Node.js 22 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: "Set GIT_TAG" | ||
| id: vars | ||
| run: | | ||
| if [ -z "${{ github.ref_name }}" ]; then | ||
| echo "TAG=latest" >> $GITHUB_ENV | ||
| else | ||
| echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV | ||
| fi | ||
| - name: Build app to root | ||
| id: build | ||
| run: | | ||
| # Export vars to ensure they are loaded before build | ||
| export $(grep -v '^#' .env.production | xargs) | ||
| # Set asset prefix and base path with git tag | ||
| ASSET_PREFIX=https://blog.vllm.ai/guidellm/ui/${TAG} | ||
| BASE_PATH=/ui/${TAG} | ||
| GIT_SHA=${{ github.sha }} | ||
| export ASSET_PREFIX=${ASSET_PREFIX} | ||
| export BASE_PATH=${BASE_PATH} | ||
| export GIT_SHA=${GIT_SHA} | ||
| npm run build | ||
| - name: Deploy versioned build to GitHub Pages | ||
| uses: peaceiris/actions-gh-pages@v3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./src/ui/out | ||
| destination_dir: ui/${TAG} | ||
| keep_files: false | ||
| user_name: ${{ github.actor }} | ||
| user_email: ${{ github.actor }}@users.noreply.github.com | ||
| publish_branch: gh-pages | ||
| publish-latest-ui-build: | ||
| needs: [publish-versioned-ui-build] | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v3 | ||
| - name: Set up Node.js 22 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: "Set GIT_TAG" | ||
| id: vars | ||
| run: | | ||
| if [ -z "${{ github.ref_name }}" ]; then | ||
| echo "TAG=latest" >> $GITHUB_ENV | ||
| else | ||
| echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV | ||
| fi | ||
| - name: Build app to root | ||
| id: build | ||
| run: | | ||
| # Export vars to ensure they are loaded before build | ||
| export $(grep -v '^#' .env.production | xargs) | ||
| # Set asset prefix and base path with git tag | ||
| ASSET_PREFIX=https://blog.vllm.ai/guidellm/ui/latest | ||
| BASE_PATH=/ui/latest | ||
| GIT_SHA=${{ github.sha }} | ||
| export ASSET_PREFIX=${ASSET_PREFIX} | ||
| export BASE_PATH=${BASE_PATH} | ||
| export GIT_SHA=${GIT_SHA} | ||
| npm run build | ||
| - name: Update latest build in GitHub Pages | ||
| uses: peaceiris/actions-gh-pages@v3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./src/ui/out | ||
| destination_dir: ui/latest | ||
| keep_files: false | ||
| user_name: ${{ github.actor }} | ||
| user_email: ${{ github.actor }}@users.noreply.github.com | ||
| publish_branch: gh-pages | ||
| build-and-push-container: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Get version from branch | ||
| run: | | ||
| echo "package_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
| - name: Fail if version is unset | ||
| if: ${{ env.package_version == '' }} | ||
| run: | | ||
| exit 1 | ||
| - name: Buildah build | ||
| id: build-image | ||
| uses: redhat-actions/buildah-build@v2 | ||
| with: | ||
| image: ${{ github.event.repository.name }} | ||
| build-args: | | ||
| GUIDELLM_BUILD_TYPE=release | ||
| tags: ${{ env.package_version }} | ||
| containerfiles: | | ||
| ./Containerfile | ||
| - name: Push To ghcr.io | ||
| id: push-to-ghcr | ||
| uses: redhat-actions/push-to-registry@v2 | ||
| with: | ||
| image: ${{ steps.build-image.outputs.image }} | ||
| tags: ${{ steps.build-image.outputs.tags }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ github.token }} | ||
| registry: ghcr.io/${{ github.repository_owner }} | ||