Skip to content

Add AMD GTT detection support #2238

Add AMD GTT detection support

Add AMD GTT detection support #2238

name: Publish Python distributions to PyPI
on:
push:
branches: ["main", "canary", "refresh"]
tags:
- v*
- RC*
pull_request:
merge_group:
jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Create virtual environment and install build tools
run: |
python -m venv .venv
venvPython=".venv/bin/python"
venvPip=".venv/bin/pip"
$venvPython -m pip install --upgrade pip
$venvPip install build
- name: Build a binary wheel and a source tarball
run: |
venvPython=".venv/bin/python"
$venvPython -m build --sdist --wheel --outdir dist/ .
version=$($venvPython setup.py --version)
echo "VERSION=$version" >> $GITHUB_ENV
- name: Test wheel
run: |
venvPython=".venv/bin/python"
venvPip=".venv/bin/pip"
venvLemonade=".venv/bin/lemonade"
$venvPython -m pip install --upgrade pip
$venvPip install "dist/lemonade_sdk-${{ env.VERSION }}-py3-none-any.whl[dev]"
$venvLemonade -i facebook/opt-125m huggingface-load llm-prompt -p "Hello, my thoughts are"
- name: Publish distribution package to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish distribution package to Test PyPI
if: startsWith(github.ref, 'refs/tags/RC')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
# This file was originally licensed under Apache 2.0. It has been modified.
# Modifications Copyright (c) 2025 AMD