Skip to content

Move reusable workflows to subdir #28

Move reusable workflows to subdir

Move reusable workflows to subdir #28

name: Release Candidate
on:
push:
branches:
- 'release/*'
jobs:
tests:
strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13"]
uses: ./.github/workflows/reusable/testing.yml

Check failure on line 13 in .github/workflows/release-candidate.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release-candidate.yml

Invalid workflow file

invalid value workflow reference: workflows must be defined at the top level of the .github/workflows/ directory
with:
python: ${{ matrix.python }}
ui-tests:
uses: ./.github/workflows/reusable/ui-testing.yml
build-and-publish:
needs: [tests]
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=candidate
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: ${{ 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.staging | xargs)
# Set asset prefix and base path with git tag
ASSET_PREFIX=https://blog.vllm.ai/guidellm/ui/release/${TAG}
BASE_PATH=/ui/release/${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/release/${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.staging | xargs)
# Set asset prefix and base path with git tag
ASSET_PREFIX=https://blog.vllm.ai/guidellm/ui/release/latest
BASE_PATH=/ui/release/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/release/latest
keep_files: false
user_name: ${{ github.actor }}
user_email: ${{ github.actor }}@users.noreply.github.com
publish_branch: gh-pages
build-and-push-container:
needs: tests
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/heads/release/}" >> $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=candidate
tags: ${{ env.package_version }}~rc
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 }}