fix: ooops #59
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: default | |
on: [push] | |
jobs: | |
sdist: | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Build sdist | |
run: | | |
uv sync | |
uv build --sdist | |
ls -lh dist | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-src | |
path: dist | |
- name: Minimize uv cache | |
run: uv cache prune --ci | |
bdist_wheel: | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ | |
{os: ubuntu-22.04, arch: x86_64}, | |
{os: ubuntu-22.04-arm, arch: aarch64}, | |
] | |
pyver: [cp313-cp313] | |
env: | |
py: /opt/python/${{ matrix.pyver }}/bin/python | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Install dependencies | |
run: | | |
sudo apt install -y xz-utils | |
uv sync | |
- name: Build volume contents | |
run: | | |
uv run python scripts/build.py --arch ${{ matrix.platform.arch }} | |
- name: Build wheel | |
run: | | |
sed -i 's/ARCH/${{ matrix.platform.arch }}/g' MANIFEST.in | |
uv build --wheel | |
- name: Apply platform tags to wheel | |
run: | | |
PKGVER=$(uv run python -c 'from importlib.metadata import version;print(version("backend.ai-krunner-alpine"), end="")') | |
GLIBC_PTAG=manylinux2014_${{ matrix.platform.arch }} # to allow installing the krunner wheel when running Backend.AI on manylinux | |
MUSL_PTAG=musllinux_1_1_${{ matrix.platform.arch }} # to allow installing the krunner wheel when running Backend.AI on musllinux | |
case "${{ matrix.platform.arch }}" in # to allow installing the krunner wheel when running Backend.AI on macOS | |
"aarch64") | |
MACOS_PTAG=macosx_11_0_arm64 ;; | |
*) | |
MACOS_PTAG=macosx_11_0_${{ matrix.platform.arch }} ;; | |
esac | |
sudo mv dist/backend_ai_krunner_alpine-${PKGVER}-*.whl \ | |
dist/backend_ai_krunner_alpine-${PKGVER}-py3-none-${GLIBC_PTAG}.${MUSL_PTAG}.${MACOS_PTAG}.whl | |
ls -lh dist | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.platform.os }}-${{ matrix.pyver }}-${{ matrix.platform.arch }} | |
path: dist | |
- name: Minimize uv cache | |
run: uv cache prune --ci | |
deploy-to-pypi: | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
needs: [sdist, bdist_wheel] | |
environment: | |
name: deploy-to-pypi | |
url: https://pypi.org/p/backend.ai-krunner-alpine | |
permissions: | |
id-token: write | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Download distributions | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist | |
- name: >- | |
Publish 🐍📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |